[8740] Make alreadyLoaded specialization select at call more explicit.

Base at report that at some platforms specialzation ignored (??).
This commit is contained in:
VladimirMangos 2009-10-26 15:30:49 +03:00
parent 6cab460f6b
commit 10a659a29a
2 changed files with 5 additions and 5 deletions

View file

@ -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;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8739"
#define REVISION_NR "8740"
#endif // __REVISION_NR_H__