Permalink
Browse files

Properties should restore up to a hundred health points

Fixes #442
  • Loading branch information...
RussellLVP committed Jan 11, 2017
1 parent 5e048fe commit 8ded695f6cb871d4cdd793a1bbb5415a72342973
Showing with 7 additions and 3 deletions.
  1. +4 −0 pawn/Interface/Math.pwn
  2. +3 −3 pawn/Interface/functions.pwn
View
@@ -42,4 +42,8 @@ class Math {
public inline random(minimum, maximum) {
return (minimum + random(maximum - minimum));
}
public inline min(Float: a, Float: b) {
return ((a) < (b) ? (a) : (b));
}
};
@@ -345,7 +345,7 @@ FortCarsonUpdate() {
GetPlayerHealth(ownerId, health);
if (health < 100)
SetPlayerHealth(ownerId, health + 2);
SetPlayerHealth(ownerId, Math->min(100.0, health + 2));
// LVP HQ.
propertyId = PropertyManager->propertyForSpecialFeature(HealthProtectionFeature);
@@ -356,7 +356,7 @@ FortCarsonUpdate() {
GetPlayerHealth(ownerId, health);
if (health < 100)
SetPlayerHealth(ownerId, health + 2);
SetPlayerHealth(ownerId, Math->min(100.0, health + 2));
// Ammunation.
propertyId = PropertyManager->propertyForSpecialFeature(ArmourFeature);
@@ -369,7 +369,7 @@ FortCarsonUpdate() {
GetPlayerArmour(ownerId, armour);
if (armour < 100)
SetPlayerArmour(ownerId, armour + 2);
SetPlayerArmour(ownerId, Math->min(100.0, armour + 2));
return 1;
}

0 comments on commit 8ded695

Please sign in to comment.