- Introduced an enum named EventHandlerType and changed the bool argument in E_NewGame to this type.

This commit is contained in:
Player701 2018-10-31 17:52:39 +03:00 committed by Christoph Oelckers
commit 3e609f2b87
4 changed files with 14 additions and 6 deletions

View file

@ -515,15 +515,17 @@ bool E_CheckReplacement( PClassActor *replacee, PClassActor **replacement )
return final;
}
void E_NewGame(bool map)
void E_NewGame(EventHandlerType handlerType)
{
bool isStatic = handlerType == EventHandlerType::Global;
// Shut down all per-map event handlers before static NewGame events.
if (!map)
if (isStatic)
E_Shutdown(true);
for (DStaticEventHandler* handler = E_FirstEventHandler; handler; handler = handler->next)
{
if (handler->IsStatic() == !map)
if (handler->IsStatic() == isStatic)
handler->NewGame();
}
}