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

◆ OnUpdate()

override void Car::OnUpdate ( float dt)
inlineprotected

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

1250 {
1251 Human driver = CrewDriver();
1252 if (driver && !driver.IsControllingVehicle())
1253 {
1254 // likely unconscious
1255 if (driver.IsAlive())
1256 {
1257 SetBrake(0.5);
1258 }
1259 }
1260
1261 if (GetGame().IsServer())
1262 {
1263 ItemBase battery = GetBattery();
1264 if (battery)
1265 {
1266 m_BatteryTimer += dt;
1268 {
1269 UpdateBattery(battery);
1270 }
1271 }
1272
1273 if ( GetGame().GetWaterDepth( GetEnginePosWS() ) > 0 )
1274 {
1275 m_DrownTime += dt;
1277 {
1278 // *dt to get damage per second
1279 AddHealth( "Engine", "Health", -DROWN_ENGINE_DAMAGE * dt);
1280 SetEngineZoneReceivedHit(true);
1281 }
1282 }
1283 else
1284 {
1285 m_DrownTime = 0;
1286 }
1287 }
1288
1289 // For visualisation of brake lights for all players
1290 float brake_coef = GetBrake();
1291 if ( brake_coef > 0 )
1292 {
1293 if ( !m_BrakesArePressed )
1294 {
1295 m_BrakesArePressed = true;
1296 SetSynchDirty();
1298 }
1299 }
1300 else
1301 {
1302 if ( m_BrakesArePressed )
1303 {
1304 m_BrakesArePressed = false;
1305 SetSynchDirty();
1307 }
1308 }
1309
1310 if ( (!GetGame().IsDedicatedServer()) && m_ForceUpdateLights )
1311 {
1312 UpdateLights();
1313 m_ForceUpdateLights = false;
1314 }
1315 }
class GP5GasMask extends MaskBase ItemBase
float m_DrownTime
Определения CarScript.c:193
vector GetEnginePosWS()
Определения CarScript.c:476
ItemBase GetBattery()
Определения CarScript.c:2872
static float DROWN_ENGINE_THRESHOLD
Определения CarScript.c:176
void UpdateBattery(ItemBase battery)
Определения CarScript.c:2886
void OnBrakesPressed()
Определения CarScript.c:1143
void OnBrakesReleased()
Определения CarScript.c:1148
static float DROWN_ENGINE_DAMAGE
Определения CarScript.c:177
const float BATTERY_UPDATE_DELAY
Определения CarScript.c:209
bool m_ForceUpdateLights
Определения CarScript.c:267
void UpdateLights(int new_gear=-1)
Определения CarScript.c:1953
bool m_BrakesArePressed
Определения CarScript.c:264
float m_BatteryTimer
Определения CarScript.c:208
proto native CGame GetGame()

Перекрестные ссылки BATTERY_UPDATE_DELAY, DROWN_ENGINE_DAMAGE, DROWN_ENGINE_THRESHOLD, GetBattery(), GetEnginePosWS(), GetGame(), m_BatteryTimer, m_BrakesArePressed, m_DrownTime, m_ForceUpdateLights, OnBrakesPressed(), OnBrakesReleased(), UpdateBattery() и UpdateLights().