Files
EscapistsReintroduced/docs/evidence/terrain-takeover-feature-2026-10-01/radio-missing/diagnostic.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

31 lines
1.2 KiB
Plaintext

modded class ArmaReforgerScripted
{
protected RadioManagerEntity m_ERRRadioFixtureOriginal;
protected bool m_ERRRadioFixtureDone;
protected override void OnWorldPostProcess(World world)
{
SCR_BaseGameMode mode = SCR_BaseGameMode.Cast(GetGameMode());
ChimeraWorld chimera = ChimeraWorld.CastFrom(world);
RadioManagerEntity radio;
if (chimera) radio = chimera.GetRadioManager();
if (Replication.IsServer() && mode && !ERR_GameMode.Cast(mode) && radio)
{
m_ERRRadioFixtureOriginal = radio;
SCR_EntityHelper.DeleteEntityAndChildren(radio);
PrintFormat("ERR RADIO FIXTURE SETUP: missing parent=%1", radio && radio.GetParent() == mode);
}
super.OnWorldPostProcess(world);
}
override void OnUpdate(BaseWorld world, float timeslice)
{
super.OnUpdate(world, timeslice);
ERR_GameMode mode = ERR_GameMode.Get();
if (m_ERRRadioFixtureDone || !mode || !mode.Active()) return;
m_ERRRadioFixtureDone = true;
ChimeraWorld chimera = ChimeraWorld.CastFrom(world);
RadioManagerEntity radio = chimera.GetRadioManager();
bool ok = radio && !radio.GetParent() && !m_ERRRadioFixtureOriginal;
PrintFormat("ERR RADIO FIXTURE RESULT: missing ok=%1 radio=%2", ok, radio);
}
}