mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16: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,12 +185,16 @@ 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)
|
||||
if (!cache || (cache && m_LastDespawnedNode != roll))
|
||||
{
|
||||
if (cache)
|
||||
Despawn1Object(m_LastDespawnedNode);
|
||||
|
||||
m_LastDespawnedNode = 0;
|
||||
Spawn1Object(roll);
|
||||
}
|
||||
else
|
||||
ReSpawn1Object(roll);
|
||||
m_LastDespawnedNode = 0;
|
||||
}
|
||||
else if (limit < EqualChanced.size() && m_SpawnedPoolAmount < limit)
|
||||
{
|
||||
std::vector<uint32> IndexList;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8666"
|
||||
#define REVISION_NR "8667"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue