mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 08:17:56 +00:00
Move preloading in the continent transport check
This commit is contained in:
@@ -427,35 +427,35 @@ void TransportMgr::SpawnContinentTransports()
|
|||||||
}
|
}
|
||||||
|
|
||||||
sLog->outString(">> Spawned %u continent motion transports in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
sLog->outString(">> Spawned %u continent motion transports in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||||
}
|
|
||||||
|
if (sWorld->getBoolConfig(CONFIG_ENABLE_CONTINENT_TRANSPORT_PRELOADING))
|
||||||
if (sWorld->getBoolConfig(CONFIG_ENABLE_CONTINENT_TRANSPORT_PRELOADING))
|
|
||||||
{
|
|
||||||
// pussywizard: preload grids for continent static transports
|
|
||||||
oldMSTime = getMSTime();
|
|
||||||
result = WorldDatabase.Query("SELECT map, position_x, position_y FROM gameobject g JOIN gameobject_template t ON g.id = t.entry WHERE t.type = 11");
|
|
||||||
count = 0;
|
|
||||||
if (result)
|
|
||||||
{
|
{
|
||||||
do
|
// pussywizard: preload grids for continent static transports
|
||||||
|
oldMSTime = getMSTime();
|
||||||
|
result = WorldDatabase.Query("SELECT map, position_x, position_y FROM gameobject g JOIN gameobject_template t ON g.id = t.entry WHERE t.type = 11");
|
||||||
|
count = 0;
|
||||||
|
if (result)
|
||||||
{
|
{
|
||||||
Field* fields = result->Fetch();
|
do
|
||||||
uint16 mapId = fields[0].GetUInt16();
|
{
|
||||||
float x = fields[1].GetFloat();
|
Field* fields = result->Fetch();
|
||||||
float y = fields[2].GetFloat();
|
uint16 mapId = fields[0].GetUInt16();
|
||||||
|
float x = fields[1].GetFloat();
|
||||||
|
float y = fields[2].GetFloat();
|
||||||
|
|
||||||
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
|
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
|
||||||
if (mapEntry && !mapEntry->Instanceable())
|
if (mapEntry && !mapEntry->Instanceable())
|
||||||
if (Map* map = sMapMgr->CreateBaseMap(mapId))
|
if (Map* map = sMapMgr->CreateBaseMap(mapId))
|
||||||
{
|
{
|
||||||
map->LoadGrid(x, y);
|
map->LoadGrid(x, y);
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (result->NextRow());
|
} while (result->NextRow());
|
||||||
|
}
|
||||||
|
|
||||||
|
sLog->outString(">> Preloaded grids for %u continent static transports in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
sLog->outString(">> Preloaded grids for %u continent static transports in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user