DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnBeforeEngineStart()

override bool OnBeforeEngineStart ( )
protected

Gets called everytime the game wants to start the engine. This callback is called on server only.

Возвращает
true if the engine can start, false otherwise.

См. определение в файле CarScript.c строка 1715

1716 {
1717 EntityAI item = null;
1718
1720 {
1721 item = GetBattery();
1722 if (!item || (item && (item.IsRuined() || item.GetCompEM().GetEnergy() < m_BatteryEnergyStartMin)))
1723 {
1724 SetCarEngineSoundState(CarEngineSoundState.START_NO_BATTERY);
1725 return false;
1726 }
1727 }
1728
1729 if (IsVitalSparkPlug())
1730 {
1731 item = FindAttachmentBySlotName("SparkPlug");
1732 if (!item || (item && item.IsRuined()))
1733 {
1734 SetCarEngineSoundState(CarEngineSoundState.START_NO_SPARKPLUG);
1735 return false;
1736 }
1737 }
1738
1739 if (IsVitalGlowPlug())
1740 {
1741 item = FindAttachmentBySlotName("GlowPlug");
1742 if (!item || (item && item.IsRuined()))
1743 {
1744 SetCarEngineSoundState(CarEngineSoundState.START_NO_SPARKPLUG);
1745 return false;
1746 }
1747 }
1748
1749 if (GetFluidFraction(CarFluid.FUEL) <= 0)
1750 {
1751 SetCarEngineSoundState(CarEngineSoundState.START_NO_FUEL);
1752 return false;
1753 }
1754
1755 return true;
1756 }
CarFluid
Type of vehicle's fluid. (native, do not change or extend)
Определения Car.c:19
void SetCarEngineSoundState(CarEngineSoundState pState)
Определения CarScript.c:2753
ItemBase GetBattery()
Определения CarScript.c:2727
bool IsVitalGlowPlug()
Определения CarScript.c:2456
float m_BatteryEnergyStartMin
Определения CarScript.c:182
bool IsVitalCarBattery()
Определения CarScript.c:2446
bool IsVitalTruckBattery()
Определения CarScript.c:2451
Определения Building.c:6

Перекрестные ссылки GetBattery(), CarScript::IsVitalCarBattery(), CarScript::IsVitalGlowPlug(), CarScript::IsVitalSparkPlug(), CarScript::IsVitalTruckBattery(), m_BatteryEnergyStartMin и SetCarEngineSoundState().