share/hedgewars/Data/Scripts/SimpleMission.lua
changeset 14231 74bf2d906097
parent 13643 690cc84e9fd6
child 14464 ead8928a59f8
--- a/share/hedgewars/Data/Scripts/SimpleMission.lua	Mon Nov 19 00:19:21 2018 +0100
+++ b/share/hedgewars/Data/Scripts/SimpleMission.lua	Mon Nov 19 00:54:36 2018 +0100
@@ -342,7 +342,7 @@
 			local g4 = (not goal.yMax) or gY <= goal.yMax
 			return g1 and g2 and g3 and g4
 		elseif goal.type == "distGearPos" or goal.type == "distGearGear" then
-			local gX, tY, tX, tY
+			local gX, gY, tX, tY
 			if goal.type == "distGearPos" then
 				if getGearValue(_G.sm.goalGears[goal.id], "sm_destroyed") then
 					-- Fail if gear was destroyed
@@ -563,7 +563,7 @@
 	end
 
 	_G.onSuddenDeath = function()
-		sm.isInSuddenDeath = true
+		_G.sm.isInSuddenDeath = true
 	end
 
 	_G.onGearWaterSkip = function(gear)