mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-28 06:53:40 +00:00
- run disconnect scripts on the level the disconnected player is on
This is nearly always the primary one but let's keep the option of using bots on secondary levels.
This commit is contained in:
parent
ebdb2643c4
commit
3c0200de19
2 changed files with 12 additions and 11 deletions
|
@ -447,8 +447,7 @@ void FCajunMaster::RemoveAllBots (FLevelLocals *Level, bool fromlist)
|
|||
}
|
||||
// [ZZ] run event hook
|
||||
E_PlayerDisconnected(i);
|
||||
//
|
||||
level.Behaviors.StartTypedScripts (SCRIPT_Disconnect, players[i].mo, true, i, true);
|
||||
Level->Behaviors.StartTypedScripts (SCRIPT_Disconnect, players[i].mo, true, i, true);
|
||||
ClearPlayer (i, !fromlist);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1691,22 +1691,23 @@ void G_DoPlayerPop(int playernum)
|
|||
}
|
||||
|
||||
// [RH] Make the player disappear
|
||||
level.Behaviors.StopMyScripts(players[playernum].mo);
|
||||
auto mo = players[playernum].mo;
|
||||
mo->Level->Behaviors.StopMyScripts(mo);
|
||||
// [ZZ] fire player disconnect hook
|
||||
E_PlayerDisconnected(playernum);
|
||||
// [RH] Let the scripts know the player left
|
||||
level.Behaviors.StartTypedScripts(SCRIPT_Disconnect, players[playernum].mo, true, playernum, true);
|
||||
if (players[playernum].mo != NULL)
|
||||
mo->Level->Behaviors.StartTypedScripts(SCRIPT_Disconnect, mo, true, playernum, true);
|
||||
if (mo != NULL)
|
||||
{
|
||||
P_DisconnectEffect(players[playernum].mo);
|
||||
players[playernum].mo->player = NULL;
|
||||
players[playernum].mo->Destroy();
|
||||
P_DisconnectEffect(mo);
|
||||
mo->player = NULL;
|
||||
mo->Destroy();
|
||||
if (!(players[playernum].mo->ObjectFlags & OF_EuthanizeMe))
|
||||
{ // We just destroyed a morphed player, so now the original player
|
||||
// has taken their place. Destroy that one too.
|
||||
players[playernum].mo->Destroy();
|
||||
}
|
||||
players[playernum].mo = NULL;
|
||||
players[playernum].mo = nullptr;
|
||||
players[playernum].camera = nullptr;
|
||||
}
|
||||
|
||||
|
@ -2033,14 +2034,15 @@ void G_DoAutoSave ()
|
|||
|
||||
file = G_BuildSaveName ("auto", nextautosave);
|
||||
|
||||
if (!(level.flags2 & LEVEL2_NOAUTOSAVEHINT))
|
||||
// The hint flag is only relevant on the primary level.
|
||||
if (!(currentUILevel->flags2 & LEVEL2_NOAUTOSAVEHINT))
|
||||
{
|
||||
nextautosave = (nextautosave + 1) % count;
|
||||
}
|
||||
else
|
||||
{
|
||||
// This flag can only be used once per level
|
||||
level.flags2 &= ~LEVEL2_NOAUTOSAVEHINT;
|
||||
currentUILevel->flags2 &= ~LEVEL2_NOAUTOSAVEHINT;
|
||||
}
|
||||
|
||||
readableTime = myasctime ();
|
||||
|
|
Loading…
Reference in a new issue