[8667] Correctly respawn pooled object in case the same object is selected for respawn.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
seirge 2009-10-18 12:09:10 +02:00 committed by ApoC
parent df3cc2ce00
commit 7eda96614d
2 changed files with 9 additions and 5 deletions

View file

@ -185,11 +185,15 @@ void PoolGroup<T>::SpawnObject(uint32 limit, bool cache)
if (limit == 1) // This is the only case where explicit chance is used
{
uint32 roll = RollOne();
if (cache && m_LastDespawnedNode != roll)
Despawn1Object(m_LastDespawnedNode);
if (!cache || (cache && m_LastDespawnedNode != roll))
{
if (cache)
Despawn1Object(m_LastDespawnedNode);
Spawn1Object(roll);
}
else
ReSpawn1Object(roll);
m_LastDespawnedNode = 0;
Spawn1Object(roll);
}
else if (limit < EqualChanced.size() && m_SpawnedPoolAmount < limit)
{

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "8666"
#define REVISION_NR "8667"
#endif // __REVISION_NR_H__