Allow WorldUnloaded events to know the next map name (if any).
This commit is contained in:
parent
51faf8a9c6
commit
457f7c31c3
4 changed files with 13 additions and 8 deletions
|
|
@ -294,11 +294,11 @@ void EventManager::WorldLoaded()
|
|||
}
|
||||
}
|
||||
|
||||
void EventManager::WorldUnloaded()
|
||||
void EventManager::WorldUnloaded(const FString& nextmap)
|
||||
{
|
||||
for (DStaticEventHandler* handler = LastEventHandler; handler; handler = handler->prev)
|
||||
{
|
||||
handler->WorldUnloaded();
|
||||
handler->WorldUnloaded(nextmap);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -629,6 +629,7 @@ DEFINE_FIELD_X(RenderEvent, FRenderEvent, Camera);
|
|||
|
||||
DEFINE_FIELD_X(WorldEvent, FWorldEvent, IsSaveGame);
|
||||
DEFINE_FIELD_X(WorldEvent, FWorldEvent, IsReopen);
|
||||
DEFINE_FIELD_X(WorldEvent, FWorldEvent, NextMap);
|
||||
DEFINE_FIELD_X(WorldEvent, FWorldEvent, Thing);
|
||||
DEFINE_FIELD_X(WorldEvent, FWorldEvent, Inflictor);
|
||||
DEFINE_FIELD_X(WorldEvent, FWorldEvent, Damage);
|
||||
|
|
@ -769,13 +770,14 @@ void DStaticEventHandler::WorldLoaded()
|
|||
}
|
||||
}
|
||||
|
||||
void DStaticEventHandler::WorldUnloaded()
|
||||
void DStaticEventHandler::WorldUnloaded(const FString& nextmap)
|
||||
{
|
||||
IFVIRTUAL(DStaticEventHandler, WorldUnloaded)
|
||||
{
|
||||
// don't create excessive DObjects if not going to be processed anyway
|
||||
if (isEmpty(func)) return;
|
||||
FWorldEvent e = owner->SetupWorldEvent();
|
||||
e.NextMap = nextmap;
|
||||
VMValue params[2] = { (DStaticEventHandler*)this, &e };
|
||||
VMCall(func, params, 2, nullptr, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue