mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Remove DM player in destructor rather than in a manual function call
This commit is contained in:
parent
ab80045329
commit
a6d9369204
1 changed files with 9 additions and 3 deletions
|
@ -2209,6 +2209,12 @@ Player::~Player()
|
|||
// when the player is deleted
|
||||
RemoveFromVehiclesAndTurrets();
|
||||
|
||||
// Added in OPM
|
||||
// Remove the player at destructor
|
||||
if (g_gametype->integer != GT_SINGLE_PLAYER && dmManager.PlayerCount()) {
|
||||
dmManager.RemovePlayer(this);
|
||||
}
|
||||
|
||||
entflags &= ~ECF_PLAYER;
|
||||
}
|
||||
|
||||
|
@ -9704,9 +9710,9 @@ void Player::Disconnect(void)
|
|||
ev->AddListener(this);
|
||||
scriptedEvents[SE_DISCONNECTED].Trigger(ev);
|
||||
|
||||
if (g_gametype->integer != GT_SINGLE_PLAYER) {
|
||||
dmManager.RemovePlayer(this);
|
||||
}
|
||||
// if (g_gametype->integer != GT_SINGLE_PLAYER) {
|
||||
// dmManager.RemovePlayer(this);
|
||||
// }
|
||||
}
|
||||
|
||||
void Player::CallVote(Event *ev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue