TBTR: Delete orphaned virtual trains on client disconnection

This commit is contained in:
Jonathan G Rennison
2020-10-09 19:26:07 +01:00
parent 348178e9eb
commit cce6d731a1
9 changed files with 41 additions and 23 deletions

View File

@@ -230,6 +230,9 @@ ServerNetworkGameSocketHandler::~ServerNetworkGameSocketHandler()
if (_redirect_console_to_client == this->client_id) _redirect_console_to_client = INVALID_CLIENT_ID;
OrderBackup::ResetUser(this->client_id);
extern void RemoveVirtualTrainsOfUser(uint32 user);
RemoveVirtualTrainsOfUser(this->client_id);
if (this->savegame != nullptr) {
this->savegame->Destroy();
this->savegame = nullptr;