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

◆ OnAction()

override bool ItemBase::OnAction ( int action_id,
Man player,
ParamsReadContext ctx )
inlineprotected

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

425 {
426 if (super.OnAction(action_id, player, ctx))
427 return true;
428
429 if (!GetGame().IsServer())
430 return false;
431
432 switch (action_id)
433 {
434 case EActions.GENERIC_FUEL_FULL:
436 return true;
437 case EActions.GENERIC_FUEL_EMPTY:
438 SetFuel(0);
439 return true;
440 case EActions.GENERIC_FUEL_INCREASE:
441 AddFuel(Math.Clamp(GetMaxFuel() * 0.1, 0.0, GetMaxFuel()));
442 return true;
443 case EActions.GENERIC_FUEL_DECREASE:
444 float value = GetMaxFuel() * -0.1;
445 if (value <= 0)
446 SetFuel(0.0);
447 return true;
448
449 AddFuel(value);
450 return true;
451 }
452
453 return false;
454 }
EActions
Определения EActions.c:2
void SetFuel(float fuel_amount)
Определения PowerGenerator.c:286
float GetMaxFuel()
Определения PowerGenerator.c:354
float AddFuel(float available_fuel)
Определения PowerGenerator.c:309
proto native CGame GetGame()

Перекрестные ссылки AddFuel(), Math::Clamp(), GetGame(), GetMaxFuel() и SetFuel().