2
0
Эх сурвалжийг харах

Fixed Wolves having over max health due to Fast Food Service (Fixes
MCCORE-39)

GJ 13 жил өмнө
parent
commit
bebc70634b

+ 4 - 4
src/main/java/com/gmail/nossr50/Combat.java

@@ -191,10 +191,10 @@ public class Combat
                         {
                         {
                             if(Math.random() * 10 > 5)
                             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());
                             }
                             }
                         }
                         }
                     }
                     }