ACF5: Fix Lua error when not hitting traitor in first turn
authorWuzzy <Wuzzy2@mail.ru>
Mon, 08 Apr 2019 23:05:54 +0200
changeset 14781 1aea457856e2
parent 14780 09d46ab83361
child 14782 8015a6e4ca3c
ACF5: Fix Lua error when not hitting traitor in first turn
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/backstab.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/backstab.lua	Mon Apr 08 22:16:44 2019 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/backstab.lua	Mon Apr 08 23:05:54 2019 +0200
@@ -742,7 +742,7 @@
 function CheckChoiceRunawayAll()
   for i= 1, 7 do
     local hog = natives[i]
-    if hog ~= spyHog and GetX(hog) >= runawayX and GetY(hog) >= runawayY and StoppedGear(hog) then
+    if hog ~= nil and GetHealth(hog) and hog ~= spyHog and GetX(hog) >= runawayX and GetY(hog) >= runawayY and StoppedGear(hog) then
       return true
     end
   end