From 7eda96614de3fe398b2e9acfb08c9264dd7665b1 Mon Sep 17 00:00:00 2001 From: seirge Date: Sun, 18 Oct 2009 12:09:10 +0200 Subject: [PATCH] [8667] Correctly respawn pooled object in case the same object is selected for respawn. Signed-off-by: ApoC --- src/game/PoolHandler.cpp | 12 ++++++++---- src/shared/revision_nr.h | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/game/PoolHandler.cpp b/src/game/PoolHandler.cpp index d1f2305bd..e038add5c 100644 --- a/src/game/PoolHandler.cpp +++ b/src/game/PoolHandler.cpp @@ -185,11 +185,15 @@ void PoolGroup::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) { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index df9759636..8b6029d4b 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8666" + #define REVISION_NR "8667" #endif // __REVISION_NR_H__