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,11 +185,15 @@ void PoolGroup<T>::SpawnObject(uint32 limit, bool cache)
|
||||||
if (limit == 1) // This is the only case where explicit chance is used
|
if (limit == 1) // This is the only case where explicit chance is used
|
||||||
{
|
{
|
||||||
uint32 roll = RollOne();
|
uint32 roll = RollOne();
|
||||||
if (cache && m_LastDespawnedNode != roll)
|
if (!cache || (cache && m_LastDespawnedNode != roll))
|
||||||
Despawn1Object(m_LastDespawnedNode);
|
{
|
||||||
|
if (cache)
|
||||||
|
Despawn1Object(m_LastDespawnedNode);
|
||||||
|
Spawn1Object(roll);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ReSpawn1Object(roll);
|
||||||
m_LastDespawnedNode = 0;
|
m_LastDespawnedNode = 0;
|
||||||
Spawn1Object(roll);
|
|
||||||
}
|
}
|
||||||
else if (limit < EqualChanced.size() && m_SpawnedPoolAmount < limit)
|
else if (limit < EqualChanced.size() && m_SpawnedPoolAmount < limit)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8666"
|
#define REVISION_NR "8667"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue