ACF2: Add more isHogAlive checks
authorWuzzy <Wuzzy2@mail.ru>
Thu, 23 May 2019 08:50:18 +0200
changeset 15033 1bce780e55ac
parent 15032 b181ff6367c9
child 15034 981f16edea02
ACF2: Add more isHogAlive checks
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua	Thu May 23 08:34:30 2019 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua	Thu May 23 08:50:18 2019 +0200
@@ -807,7 +807,7 @@
 end
 
 function CheckRefuse()
-  return GetHealth(dense) and GetX(dense) > 1400 and StoppedGear(dense)
+  return isHogAlive(dense) and GetX(dense) > 1400 and StoppedGear(dense)
 end
 
 function DoRefuse()
@@ -818,7 +818,7 @@
 end
 
 function CheckAccept()
-  if not GetHealth(dense) then
+  if not isHogAlive(dense) then
     return false
   end
   if GetX(dense) < 1300 then
@@ -842,7 +842,7 @@
 end
 
 function CheckConfront()
-  return cyborgAttacked and denseDead == false and StoppedGear(dense)
+  return cyborgAttacked and isHogAlive(dense) and StoppedGear(dense)
 end
 
 function DoConfront()
@@ -906,6 +906,9 @@
   if stage == loseStage then
     return false
   end
+  if not isHogAlive(dense) then
+    return false
+  end
   return (shotgunTaken and grenadeTaken) or GetX(dense) > 2700
 end