mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[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:
parent
455f9d0aac
commit
b3ab347028
2 changed files with 10 additions and 2 deletions
|
|
@ -2009,12 +2009,20 @@ void GameObject::TickCapturePoint()
|
||||||
owner->SendUpdateWorldState(info->capturePoint.worldState1, WORLD_STATE_REMOVE);
|
owner->SendUpdateWorldState(info->capturePoint.worldState1, WORLD_STATE_REMOVE);
|
||||||
|
|
||||||
// player left capture point zone
|
// 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)
|
// return if there are not enough players capturing the point (works because minSuperiority is always 1)
|
||||||
if (rangePlayers == 0)
|
if (rangePlayers == 0)
|
||||||
|
{
|
||||||
|
// set to inactive if all players left capture point zone
|
||||||
|
if (m_UniqueUsers.empty())
|
||||||
|
SetActiveObjectState(false);
|
||||||
return;
|
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
|
// cap speed
|
||||||
int maxSuperiority = info->capturePoint.maxSuperiority;
|
int maxSuperiority = info->capturePoint.maxSuperiority;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "0126"
|
#define REVISION_NR "12096"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue