Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
27 lines
1.3 KiB
C
27 lines
1.3 KiB
C
modded class ArmaReforgerScripted
|
|
{
|
|
protected override void OnWorldPostProcess(World world)
|
|
{
|
|
string enabled;
|
|
if (!SCR_Global.IsEditMode() && System.GetCLIParam("errTerrainTakeover", enabled) && enabled == "1" && !ERR_GameMode.Get())
|
|
{
|
|
PrintFormat("ERR TAKEOVER PROBE: old mode=%1 authority=%2", GetGameMode(), Replication.IsServer());
|
|
array<IEntity> managers = {GetGameMode(), GetLoadoutManager(), GetFactionManager(), GetPerceptionManager(), GetChat()};
|
|
managers.Insert(world.GetRadioManager());
|
|
foreach (IEntity manager : managers) if (manager) SCR_EntityHelper.DeleteEntityAndChildren(manager);
|
|
PrintFormat("ERR TAKEOVER PROBE: removed mode=%1 factions=%2", GetGameMode(), GetFactionManager());
|
|
if (Replication.IsServer())
|
|
{
|
|
EntitySpawnParams markerParams = new EntitySpawnParams();
|
|
markerParams.TransformMode = ETransformMode.WORLD;
|
|
markerParams.Transform[3] = "1525 0 5075";
|
|
IEntity marker = SpawnEntity(GenericEntity, world, markerParams);
|
|
marker.SetName("ERR_Airfield_0");
|
|
IEntity mode = SpawnEntityPrefab(Resource.Load("{8FB1559AE3F29722}Prefabs/ERR/TerrainConnector.et"), world);
|
|
PrintFormat("ERR TAKEOVER PROBE: spawned mode=%1 registered=%2 factions=%3", mode, GetGameMode(), GetFactionManager());
|
|
}
|
|
}
|
|
super.OnWorldPostProcess(world);
|
|
}
|
|
}
|