From bebc70634bf871acf718d94b9f2e68055c5257ab Mon Sep 17 00:00:00 2001 From: GJ Date: Wed, 22 Feb 2012 12:18:21 -0500 Subject: [PATCH] Fixed Wolves having over max health due to Fast Food Service (Fixes MCCORE-39) --- src/main/java/com/gmail/nossr50/Combat.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/Combat.java b/src/main/java/com/gmail/nossr50/Combat.java index 54f2597d8..7e023c9cc 100644 --- a/src/main/java/com/gmail/nossr50/Combat.java +++ b/src/main/java/com/gmail/nossr50/Combat.java @@ -191,10 +191,10 @@ public class Combat { if(Math.random() * 10 > 5) { - theWolf.setHealth(theWolf.getHealth()+event.getDamage()); - - if(theWolf.getHealth() > theWolf.getMaxHealth()) - theWolf.setHealth(theWolf.getMaxHealth()); + if(theWolf.getHealth() + event.getDamage() <= 20) + theWolf.setHealth(theWolf.getHealth()+event.getDamage()); + else + theWolf.setHealth(theWolf.getMaxHealth()); } } }