mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 05:27:19 +00:00
Address players leaving Battle of Nimbus Station causing a crash that wont save (#600)
This commit is contained in:
parent
06dc18fb49
commit
94e161df55
@ -60,8 +60,11 @@ void BaseWavesServer::BaseStartup(Entity* self) {
|
||||
|
||||
// Done
|
||||
void BaseWavesServer::BasePlayerExit(Entity* self, Entity* player) {
|
||||
state.waitingPlayers.erase(std::find(state.waitingPlayers.begin(), state.waitingPlayers.end(), player->GetObjectID()));
|
||||
state.players.erase(std::find(state.players.begin(), state.players.end(), player->GetObjectID()));
|
||||
auto waitingPlayerToErase = std::find(state.waitingPlayers.begin(), state.waitingPlayers.end(), player->GetObjectID());
|
||||
if (waitingPlayerToErase != state.waitingPlayers.end()) state.waitingPlayers.erase(waitingPlayerToErase);
|
||||
|
||||
auto playerToErase = std::find(state.players.begin(), state.players.end(), player->GetObjectID());
|
||||
if (playerToErase != state.players.end()) state.players.erase(playerToErase);
|
||||
|
||||
if (!self->GetNetworkVar<bool>(WavesStartedVariable)) {
|
||||
PlayerConfirmed(self);
|
||||
|
Loading…
Reference in New Issue
Block a user