Files
EscapistsReintroduced/docs/evidence/terrain-takeover-feature-2026-10-01/client-experiment-28/ERR_TerrainTakeoverManagers.c.txt
T
jakub 6a667d8deb Capture current mission, AI, map and administration development
Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
2026-10-13 22:52:53 +02:00

96 lines
3.0 KiB
Plaintext

// Vanilla caches are tied to the original game mode. Release its exact
// components before takeover. Some vanilla destructors unconditionally clear
// their static cache later; resolve those getters from the current takeover
// owner so delayed destruction cannot invalidate the replacement.
modded class SCR_ArsenalManagerComponent
{
static void ERR_ReleaseTerrainSingleton(SCR_ArsenalManagerComponent expected)
{
if (s_Instance == expected) s_Instance = null;
}
}
modded class SCR_GroupsManagerComponent
{
static void ERR_ReleaseTerrainSingleton(SCR_GroupsManagerComponent expected)
{
if (s_Instance == expected) s_Instance = null;
}
}
modded class SCR_SupportStationManagerComponent
{
static void ERR_ReleaseTerrainSingleton(SCR_SupportStationManagerComponent expected)
{
if (s_Instance == expected) s_Instance = null;
}
}
modded class SCR_TaskFinishHistoryManagerComponent
{
static void ERR_ReleaseTerrainSingleton(SCR_TaskFinishHistoryManagerComponent expected)
{
if (s_Instance == expected) s_Instance = null;
}
override static SCR_TaskFinishHistoryManagerComponent GetInstance()
{
ERR_TerrainTakeoverMode mode;
if (GetGame()) mode = ERR_TerrainTakeoverMode.Cast(GetGame().GetGameMode());
if (mode) return SCR_TaskFinishHistoryManagerComponent.Cast(mode.FindComponent(SCR_TaskFinishHistoryManagerComponent));
return super.GetInstance();
}
}
modded class SCR_TaskManagerUIComponent
{
static void ERR_ReleaseTerrainSingleton(SCR_TaskManagerUIComponent expected)
{
if (s_Instance == expected) s_Instance = null;
}
override static SCR_TaskManagerUIComponent GetInstance()
{
ERR_TerrainTakeoverMode mode;
if (GetGame()) mode = ERR_TerrainTakeoverMode.Cast(GetGame().GetGameMode());
if (mode) return SCR_TaskManagerUIComponent.Cast(mode.FindComponent(SCR_TaskManagerUIComponent));
return super.GetInstance();
}
}
modded class SCR_TextsTaskManagerComponent
{
static void ERR_ReleaseTerrainSingleton(SCR_TextsTaskManagerComponent expected)
{
if (s_Instance == expected) s_Instance = null;
}
override static SCR_TextsTaskManagerComponent GetInstance()
{
ERR_TerrainTakeoverMode mode;
if (GetGame()) mode = ERR_TerrainTakeoverMode.Cast(GetGame().GetGameMode());
if (mode) return SCR_TextsTaskManagerComponent.Cast(mode.FindComponent(SCR_TextsTaskManagerComponent));
return super.GetInstance();
}
}
modded class SCR_MapMarkerManagerComponent
{
override static SCR_MapMarkerManagerComponent GetInstance()
{
ERR_TerrainTakeoverMode mode;
if (GetGame()) mode = ERR_TerrainTakeoverMode.Cast(GetGame().GetGameMode());
if (mode) return SCR_MapMarkerManagerComponent.Cast(mode.FindComponent(SCR_MapMarkerManagerComponent));
return super.GetInstance();
}
}
modded class SCR_RespawnSystemComponent
{
override static SCR_RespawnSystemComponent GetInstance()
{
ERR_TerrainTakeoverMode mode;
if (GetGame()) mode = ERR_TerrainTakeoverMode.Cast(GetGame().GetGameMode());
if (mode) return SCR_RespawnSystemComponent.Cast(mode.FindComponent(SCR_RespawnSystemComponent));
return super.GetInstance();
}
}