[12096] Prevent unloading go before all players left capture point zone

This fixes m_UniqueUsers not being cleared for example if grid is set to idle and would therefore think that some players are still in range on grid reactivation causing the slider not to appear
This commit is contained in:
stfx 2012-08-17 18:36:51 +02:00 committed by Antz
parent 455f9d0aac
commit b3ab347028
2 changed files with 10 additions and 2 deletions

View file

@ -2009,12 +2009,20 @@ void GameObject::TickCapturePoint()
owner->SendUpdateWorldState(info->capturePoint.worldState1, WORLD_STATE_REMOVE);
// player left capture point zone
m_UniqueUsers.erase((*itr));
m_UniqueUsers.erase(*itr);
}
// return if there are not enough players capturing the point (works because minSuperiority is always 1)
if (rangePlayers == 0)
{
// set to inactive if all players left capture point zone
if (m_UniqueUsers.empty())
SetActiveObjectState(false);
return;
}
// prevents unloading gameobject before all players left capture point zone (to prevent m_UniqueUsers not being cleared if grid is set to idle)
SetActiveObjectState(true);
// cap speed
int maxSuperiority = info->capturePoint.maxSuperiority;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "0126"
#define REVISION_NR "12096"
#endif // __REVISION_NR_H__