mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 22:34:33 +01:00
Add map changed hook
This commit is contained in:
@@ -31,6 +31,7 @@ static const EnumMap<HOOK_TYPE> HooksLookupTable({
|
||||
{ "action.location", HOOK_TYPE::ACTION_LOCATION },
|
||||
{ "guest.generation", HOOK_TYPE::GUEST_GENERATION },
|
||||
{ "vehicle.crash", HOOK_TYPE::VEHICLE_CRASH },
|
||||
{ "map.change", HOOK_TYPE::MAP_CHANGE },
|
||||
{ "map.save", HOOK_TYPE::MAP_SAVE },
|
||||
});
|
||||
|
||||
@@ -97,6 +98,15 @@ bool HookEngine::HasSubscriptions(HOOK_TYPE type) const
|
||||
return !hookList.Hooks.empty();
|
||||
}
|
||||
|
||||
bool HookEngine::IsValidHookForPlugin(HOOK_TYPE type, Plugin& plugin) const
|
||||
{
|
||||
if (type == HOOK_TYPE::MAP_CHANGE && plugin.GetMetadata().Type != PluginType::Intransient)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void HookEngine::Call(HOOK_TYPE type, bool isGameStateMutable)
|
||||
{
|
||||
auto& hookList = GetHookList(type);
|
||||
|
||||
Reference in New Issue
Block a user