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

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )

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

50 {
51 if (!super.ActionCondition(player, target, item))
52 return false;
53
54 PlayerBase targetPlayer = PlayerBase.Cast(target.GetObject());
55 ConsumeConditionData dta = new ConsumeConditionData(targetPlayer,item);
56 if (!targetPlayer || !targetPlayer.CanEatAndDrink() || !targetPlayer.CanConsumeFood(dta) || !item.CanBeConsumed(dta))
57 return false;
58
59 float angleDiff = Math.AbsFloat(player.GetDirection().VectorToAngles()[0] - targetPlayer.GetDirection().VectorToAngles()[0]);
60 if (angleDiff < 135 || angleDiff > 225) // not in 90 deg cone angle facing the other player
61 return false;
62
63 if (targetPlayer.GetPerformedActionID() != -1 || targetPlayer.GetActivePrimarySymptomID() == SymptomIDs.SYMPTOM_VOMIT)
64 return false;
65
66 return item.GetQuantity() > item.GetQuantityMin();
67 }
Определения EnMath.c:7
Определения PlayerBaseClient.c:2
static proto float AbsFloat(float f)
Returns absolute value.

Перекрестные ссылки Math::AbsFloat() и ActionTarget.