make the setmaptier query not error

This commit is contained in:
rtldg 2021-11-28 06:02:20 +00:00
parent b6a81e04e3
commit e32b79c941

View File

@ -441,7 +441,7 @@ public void SQL_FillTierCache_Callback(Database db, DBResultSet results, const c
{ {
char sQuery[512]; char sQuery[512];
FormatEx(sQuery, sizeof(sQuery), "REPLACE INTO %smaptiers (map, tier) VALUES ('%s', %d);", gS_MySQLPrefix, gS_Map, gI_Tier); FormatEx(sQuery, sizeof(sQuery), "REPLACE INTO %smaptiers (map, tier) VALUES ('%s', %d);", gS_MySQLPrefix, gS_Map, gI_Tier);
gH_SQL.Query(SQL_SetMapTier_Callback, sQuery, gI_Tier, DBPrio_High); gH_SQL.Query(SQL_SetMapTier_Callback, sQuery, 0, DBPrio_High);
} }
} }
@ -747,12 +747,17 @@ public void SQL_SetMapTier_Callback(Database db, DBResultSet results, const char
return; return;
} }
data.Reset(); int client;
int client = data.ReadCell();
char map[PLATFORM_MAX_PATH]; char map[PLATFORM_MAX_PATH];
data.ReadString(map, sizeof(map));
if (StrEqual(map, gS_Map)) if (data != null)
{
data.Reset();
client = data.ReadCell();
data.ReadString(map, sizeof(map));
}
if (data == null || StrEqual(map, gS_Map))
{ {
ReallyRecalculateCurrentMap(); ReallyRecalculateCurrentMap();
} }