mirror of
https://github.com/minetest/minetestmapper.git
synced 2024-12-26 02:40:37 +01:00
Fix getting MapBlocks for abs(z) > 2048 with sqlite3 backend (fixed #31)
This commit is contained in:
parent
ae9321de1e
commit
4db3040f2a
@ -62,8 +62,8 @@ void DBSQLite3::getBlocksOnZ(std::map<int16_t, BlockList> &blocks, int16_t zPos)
|
||||
int result;
|
||||
|
||||
// Magic numbers!
|
||||
int64_t minPos = (zPos * 0x1000000) - 0x800000;
|
||||
int64_t maxPos = (zPos * 0x1000000) + 0x7FFFFF;
|
||||
int64_t minPos = encodeBlockPos(BlockPos(0, -2048, zPos));
|
||||
int64_t maxPos = encodeBlockPos(BlockPos(0, 2048, zPos)) - 1;
|
||||
|
||||
SQLOK(bind_int64(stmt_get_blocks_z, 1, minPos));
|
||||
SQLOK(bind_int64(stmt_get_blocks_z, 2, maxPos));
|
||||
|
Loading…
Reference in New Issue
Block a user