50 {
51 if (!super.ActionCondition(player, target, item))
52 return false;
53
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)
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 }
static proto float AbsFloat(float f)
Returns absolute value.