13 if (state !=
EDamageState.DESTROYED || !m_Asset || !m_SupportEntity)
16 SCR_DamageManagerComponent objectDmgManager = SCR_DamageManagerComponent.Cast(SCR_DamageManagerComponent.GetDamageManager(m_Asset));
19 objectDmgManager.GetOnDamageStateChanged().Remove(OnObjectDamage);
20 GetGame().GetCallqueue().Remove(CheckEngineDrowned);
22 VehicleControllerComponent_SA vehicleController = VehicleControllerComponent_SA.Cast(m_Asset.FindComponent(VehicleControllerComponent_SA));
23 if (vehicleController)
24 vehicleController.GetOnEngineStop().Remove(CheckEngineDrowned);
27 m_SupportEntity.FinishTask(
this);
31 void CheckEngineDrowned()
33 if (!m_Asset || !m_SupportEntity)
36 VehicleControllerComponent_SA vehicleController = VehicleControllerComponent_SA.Cast(m_Asset.FindComponent(VehicleControllerComponent_SA));
37 if (vehicleController && vehicleController.GetEngineDrowned())
39 vehicleController.GetOnEngineStop().Remove(CheckEngineDrowned);
40 GetGame().GetCallqueue().Remove(CheckEngineDrowned);
42 SCR_DamageManagerComponent objectDmgManager = SCR_DamageManagerComponent.Cast(SCR_DamageManagerComponent.GetDamageManager(m_Asset));
44 objectDmgManager.GetOnDamageStateChanged().Remove(OnObjectDamage);
46 m_SupportEntity.FinishTask(
this);
51 override void RehookTaskAsset(IEntity
object)
58 SCR_DamageManagerComponent objectDmgManager = SCR_DamageManagerComponent.Cast(SCR_DamageManagerComponent.GetDamageManager(m_Asset));
60 objectDmgManager.GetOnDamageStateChanged().Insert(OnObjectDamage);
62 if (Vehicle.Cast(m_Asset))
64 VehicleControllerComponent_SA vehicleController = VehicleControllerComponent_SA.Cast(m_Asset.FindComponent(VehicleControllerComponent_SA));
65 if (vehicleController)
66 vehicleController.GetOnEngineStop().Insert(CheckEngineDrowned);
70 GetGame().GetCallqueue().CallLater(CheckEngineDrowned, 5000,
true);
75 override bool SetSupportEntity()
81 Print(
"ScenarioFramework: Task Destroy support entity not found in the world, task won't be created!", LogLevel.ERROR);
96 SCR_DamageManagerComponent objectDmgManager = SCR_DamageManagerComponent.Cast(SCR_DamageManagerComponent.GetDamageManager(m_Asset));
98 objectDmgManager.GetOnDamageStateChanged().Insert(OnObjectDamage);
100 if (Vehicle.Cast(m_Asset))
102 VehicleControllerComponent_SA vehicleController = VehicleControllerComponent_SA.Cast(m_Asset.FindComponent(VehicleControllerComponent_SA));
103 if (vehicleController)
104 vehicleController.GetOnEngineStop().Insert(CheckEngineDrowned);
108 GetGame().GetCallqueue().CallLater(CheckEngineDrowned, 5000,
true);