42 lines
2.1 KiB
Plaintext
42 lines
2.1 KiB
Plaintext
#ifdef WORKBENCH
|
|
modded class ERR_GameMode
|
|
{
|
|
protected Vehicle m_ERRBMP19;
|
|
protected override void EOnInit(IEntity owner)
|
|
{
|
|
super.EOnInit(owner);
|
|
string fixture;
|
|
if (SCR_Global.IsEditMode() || !Replication.IsServer() || !System.GetCLIParam("errSmokeOutcome", fixture) || fixture != "bmp-19") return;
|
|
GetGame().GetCallqueue().CallLater(ERR_BMP19Spawn, 1000, false);
|
|
}
|
|
protected void ERR_BMP19Spawn()
|
|
{
|
|
m_ERRBMP19 = Vehicle.Cast(ERR_Actors.Spawn("{1DC01AAACFFA8B63}Prefabs/Vehicles/Tracked/BMP1/BMP1_Base.et", ERR_Actors.Ground("4788 0 11528") + "0 0.5 0"));
|
|
if (!m_ERRBMP19) { Print("ERR SMOKE FAIL: BMP19 native prefab spawn", LogLevel.ERROR); return; }
|
|
Own(m_ERRBMP19);
|
|
GetGame().GetCallqueue().CallLater(ERR_BMP19Inspect, 4000, false);
|
|
}
|
|
protected void ERR_BMP19Inspect()
|
|
{
|
|
VehicleWheeledSimulation sim = VehicleWheeledSimulation.Cast(m_ERRBMP19.FindComponent(VehicleWheeledSimulation));
|
|
if (!sim || sim.WheelCount() != 12) { Print("ERR SMOKE FAIL: BMP19 twelve native road wheels initialized", LogLevel.ERROR); return; }
|
|
for (int i = 0; i < sim.WheelCount(); i++)
|
|
{
|
|
float radius = sim.WheelGetRadius(i);
|
|
if (Math.AbsFloat(radius - 0.32) > 0.01) { Print("ERR SMOKE FAIL: BMP19 native wheel radius", LogLevel.ERROR); return; }
|
|
}
|
|
Print("ERR SMOKE PASS: BMP19 native simulation exposes all twelve correctly sized road wheels");
|
|
sim.EngineStart();
|
|
GetGame().GetCallqueue().CallLater(ERR_BMP19Engine, 3000, false);
|
|
}
|
|
protected void ERR_BMP19Engine()
|
|
{
|
|
VehicleWheeledSimulation sim = VehicleWheeledSimulation.Cast(m_ERRBMP19.FindComponent(VehicleWheeledSimulation));
|
|
PrintFormat("ERR BMP19 ENGINE: running=%1 rpm=%2 wheelCount=%3", sim.EngineIsOn(), sim.EngineGetRPM(), sim.WheelCount());
|
|
if (!sim.EngineIsOn() || sim.EngineGetRPM() <= 0) { Print("ERR SMOKE FAIL: BMP19 native engine simulation", LogLevel.ERROR); return; }
|
|
Print("ERR SMOKE PASS: BMP19 native engine simulation runs after explicit diagnostic start");
|
|
Print("ERR SMOKE COMPLETE: BMP19 tire and engine initialization; driving and network replication not exercised");
|
|
}
|
|
}
|
|
#endif
|