Battalion Highland: Fix incorrect health bonus (bug 788)
authorWuzzy <Wuzzy2@mail.ru>
Fri, 27 Sep 2019 03:52:18 +0200
changeset 15433 c95efbab66e6
parent 15432 b704b0c11129
child 15434 c0ad952894d9
Battalion Highland: Fix incorrect health bonus (bug #788)
share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua	Fri Sep 27 01:29:32 2019 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Battalion.lua	Fri Sep 27 03:52:18 2019 +0200
@@ -752,6 +752,7 @@
 
   hogInfo[hog]['variant'] = hogVar
   SetHealth(hog, variants[hogVar]["hp"])
+  hogInfo[hog]['maxHp'] = variants[hogVar]["hp"]
 end
 
 function getHogInfo(hog, info)
@@ -1150,8 +1151,7 @@
     end
 
     hpDiff = div(deathMaxHP * highEnemyKillHPBonus, 100)
-    newHP = curHP + hpDiff
-    HealHog(CurHog, newHP)
+    HealHog(CurHog, hpDiff)
   -- Friendly fire! Punish hog by removing weapons and helpers from pool
   -- and reduce health
   else