From: JacobF Date: Sun, 4 Sep 2011 21:01:28 +0000 (-0400) Subject: These numbers were well exceeding 2^32... X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=d670c831c2183967a5b5e2cdd104fd07a40bb3f4;p=zefram%2Fminetest%2Fminetest_engine.git These numbers were well exceeding 2^32... --- diff --git a/src/map.cpp b/src/map.cpp index 41c4e17d..46ee5b53 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -2849,8 +2849,9 @@ bool ServerMap::loadFromFolders() { return false; } -int ServerMap::getBlockAsInteger(const v3s16 pos) { - return (pos.Z+2048)*16777216 + (pos.Y+2048)*4096 + pos.X; +sqlite3_int64 ServerMap::getBlockAsInteger(const v3s16 pos) { + return (sqlite3_int64)pos.Z*16777216 + + (sqlite3_int64)pos.Y*4096 + (sqlite3_int64)pos.X; } void ServerMap::createDirs(std::string path) @@ -3318,7 +3319,7 @@ void ServerMap::saveBlock(MapBlock *block) std::string tmp = o.str(); const char *bytes = tmp.c_str(); - if(sqlite3_bind_int(m_database_write, 1, getBlockAsInteger(p3d)) != SQLITE_OK) + if(sqlite3_bind_int64(m_database_write, 1, getBlockAsInteger(p3d)) != SQLITE_OK) dstream<<"WARNING: Block position failed to bind: "<