mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16: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);
|
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
|
// Non creature objects not walk by grids
|
||||||
return false;
|
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>
|
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
|
// at instanced maps will use dynamic selected guid
|
||||||
// and then duplicate just will not detected and will be 2 creature with identical DB guid
|
// and then duplicate just will not detected and will be 2 creature with identical DB guid
|
||||||
// with some chance
|
// 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
|
continue; // still loaded in another grid (move from respawn [this] grid early), we not need second copy
|
||||||
|
|
||||||
T* obj = new T;
|
T* obj = new T;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8739"
|
#define REVISION_NR "8740"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue