Allow off-airport extraction across terrains; record Workshop 0.0.124
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
modded class ERR_ScenarioComponent
|
||||
{
|
||||
override ERR_PrepareResult Prepare()
|
||||
{
|
||||
if (System.IsCLIParam("errExtractionTerrain")) m_TerrainIndependent = true;
|
||||
return super.Prepare();
|
||||
}
|
||||
}
|
||||
modded class ERR_GameMode
|
||||
{
|
||||
protected bool m_ERRExtractionChecked;
|
||||
protected override void EOnInit(IEntity owner)
|
||||
{
|
||||
super.EOnInit(owner);
|
||||
if (Replication.IsServer() && !SCR_Global.IsEditMode()) GetGame().GetCallqueue().CallLater(ERR_CheckAnywhereExtraction, 500, true);
|
||||
}
|
||||
protected void ERR_CheckAnywhereExtraction()
|
||||
{
|
||||
if (m_ERRExtractionChecked) return;
|
||||
if (!PreparationError().IsEmpty())
|
||||
{
|
||||
Print("ERR SMOKE FAIL: extraction mission " + PreparationError(), LogLevel.ERROR);
|
||||
m_ERRExtractionChecked = true; return;
|
||||
}
|
||||
if (!Active()) return;
|
||||
SCR_PlayerController pc = SCR_PlayerController.Cast(GetGame().GetPlayerController());
|
||||
if (!pc || !pc.GetControlledEntity() || !Players().CurrentActor(pc.GetControlledEntity())) return;
|
||||
m_ERRExtractionChecked = true;
|
||||
ERR_SiteRuntime extraction = Sites().Find("everon-extraction-1");
|
||||
ERR_SiteRuntime prison = Sites().Find("everon-prison-1");
|
||||
if (!extraction || !prison || !extraction.Definition.PlacementResolved || extraction.Definition.RequireAirfield)
|
||||
{ Print("ERR SMOKE FAIL: extraction was not generated without airport requirement", LogLevel.ERROR); return; }
|
||||
vector point = extraction.Definition.Position;
|
||||
float distance = vector.DistanceXZ(point, prison.Definition.Position);
|
||||
float fromOldPad = vector.DistanceXZ(point, "4800.953 0 11487.412");
|
||||
PrintFormat("ERR EXTRACTION ANYWHERE: terrainIndependent=%1 pickup=%2 prisonDistance=%3 oldAirportPadDistance=%4", System.IsCLIParam("errExtractionTerrain"), point, distance, fromOldPad);
|
||||
if (distance + 100 >= EscapeRadius() || fromOldPad < 600 || !ERR_Actors.DryGround(point) || !ERR_RescueLanding.Fits(point))
|
||||
{ Print("ERR SMOKE FAIL: extraction distance/ground/fleet verification", LogLevel.ERROR); return; }
|
||||
Print("ERR SMOKE PASS: full mission and player admission; generated off-airport extraction, inside escape boundary with dry ground and rescue fleet space");
|
||||
Print("ERR SMOKE COMPLETE: anywhere extraction");
|
||||
GetGame().GetCallqueue().Remove(ERR_CheckAnywhereExtraction);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user