mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[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:
parent
df3cc2ce00
commit
7eda96614d
2 changed files with 9 additions and 5 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue