From 91b1346761238e5ccf8ae5fc6159415fc2dc6d8d Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Sun, 5 Oct 2025 18:06:41 +0100 Subject: [PATCH] Revert "Support wrapped arthimetic types" elsid provided an alternative. This reverts commit b0cf1483932473adf79c5a14760d4a4435681759. --- components/detournavigator/navmeshdb.cpp | 10 +++++----- components/sqlite3/request.hpp | 8 +------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/components/detournavigator/navmeshdb.cpp b/components/detournavigator/navmeshdb.cpp index bfc6dd5ecb..e3ef995cd7 100644 --- a/components/detournavigator/navmeshdb.cpp +++ b/components/detournavigator/navmeshdb.cpp @@ -195,7 +195,7 @@ namespace DetourNavigator TileId NavMeshDb::getMaxTileId() { TileId tileId{ 0 }; - request(*mDb, mGetMaxTileId, &tileId, 1); + request(*mDb, mGetMaxTileId, &tileId.mValue, 1); return tileId; } @@ -203,7 +203,7 @@ namespace DetourNavigator ESM::RefId worldspace, const TilePosition& tilePosition, const std::vector& input) { Tile result; - auto row = std::tie(result.mTileId, result.mVersion); + auto row = std::tie(result.mTileId.mValue, result.mVersion.mValue); const std::vector compressedInput = Misc::compress(input); if (&row == request(*mDb, mFindTile, &row, 1, worldspace.serializeText(), tilePosition, compressedInput)) return {}; @@ -214,7 +214,7 @@ namespace DetourNavigator ESM::RefId worldspace, const TilePosition& tilePosition, const std::vector& input) { TileData result; - auto row = std::tie(result.mTileId, result.mVersion, result.mData); + auto row = std::tie(result.mTileId.mValue, result.mVersion.mValue, result.mData); const std::vector compressedInput = Misc::compress(input); if (&row == request(*mDb, mGetTileData, &row, 1, worldspace.serializeText(), tilePosition, compressedInput)) return {}; @@ -255,14 +255,14 @@ namespace DetourNavigator ShapeId NavMeshDb::getMaxShapeId() { ShapeId shapeId{ 0 }; - request(*mDb, mGetMaxShapeId, &shapeId, 1); + request(*mDb, mGetMaxShapeId, &shapeId.mValue, 1); return shapeId; } std::optional NavMeshDb::findShapeId(std::string_view name, ShapeType type, const Sqlite3::ConstBlob& hash) { ShapeId shapeId; - if (&shapeId == request(*mDb, mFindShapeId, &shapeId, 1, name, type, hash)) + if (&shapeId.mValue == request(*mDb, mFindShapeId, &shapeId.mValue, 1, name, type, hash)) return {}; return shapeId; } diff --git a/components/sqlite3/request.hpp b/components/sqlite3/request.hpp index af1a090ba0..d4737a41f9 100644 --- a/components/sqlite3/request.hpp +++ b/components/sqlite3/request.hpp @@ -97,7 +97,7 @@ namespace Sqlite3 value = nullptr; } - template >> + template inline auto copyColumn(sqlite3& /*db*/, sqlite3_stmt& statement, int index, int type, T& value) { switch (type) @@ -116,12 +116,6 @@ namespace Sqlite3 + " that does not match expected output type: SQLITE_INTEGER or SQLITE_FLOAT or SQLITE_NULL"); } - template >> - inline auto copyColumn(sqlite3& db, sqlite3_stmt& statement, int index, int type, T& value) - { - return copyColumn(db, statement, index, type, value.mValue); - } - inline void copyColumn(sqlite3& db, sqlite3_stmt& statement, int index, int type, std::string& value) { if (type != SQLITE_TEXT)