520 {
522 {
523 float quantity = pItem.GetQuantity() - pAmount;
524 quantity =
Math.
Clamp(quantity, 0, pItem.GetQuantityMax());
525 pItem.SetQuantity(quantity);
526 }
527 }
proto native CGame GetGame()
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.