mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[8740] Make alreadyLoaded specialization select at call more explicit.
Base at report that at some platforms specialzation ignored (??).
This commit is contained in:
parent
6cab460f6b
commit
10a659a29a
2 changed files with 5 additions and 5 deletions
|
|
@ -104,15 +104,15 @@ template<> void addUnitState(Creature *obj, CellPair const& cell_pair)
|
|||
obj->SetCurrentCell(cell);
|
||||
}
|
||||
|
||||
template<class T> bool alreadyLoaded(Map* /*map*/, uint32 /*guid*/, T* /*fake*/)
|
||||
template<class T> bool alreadyLoaded(Map* /*map*/, uint32 /*guid*/)
|
||||
{
|
||||
// Non creature objects not walk by grids
|
||||
return false;
|
||||
}
|
||||
|
||||
template<> bool alreadyLoaded(Map* map, uint32 guid, Creature* fake)
|
||||
template<> bool alreadyLoaded<Creature>(Map* map, uint32 guid)
|
||||
{
|
||||
return map->GetObjectsStore().find<Creature>(guid,fake);
|
||||
return map->GetObjectsStore().find<Creature>(guid,(Creature*)NULL);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
|
|
@ -128,7 +128,7 @@ void LoadHelper(CellGuidSet const& guid_set, CellPair &cell, GridRefManager<T> &
|
|||
// at instanced maps will use dynamic selected guid
|
||||
// and then duplicate just will not detected and will be 2 creature with identical DB guid
|
||||
// with some chance
|
||||
if (alreadyLoaded(map,guid,(T*)NULL))
|
||||
if (alreadyLoaded<T>(map,guid))
|
||||
continue; // still loaded in another grid (move from respawn [this] grid early), we not need second copy
|
||||
|
||||
T* obj = new T;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue