HedgeEditor: Fix Lua error when trying to set ShoppaBalance rank without anything being selected
authorWuzzy <almikes@aol.com>
Thu, 14 Apr 2016 16:28:59 +0200
changeset 12018 7fdf381303b1
parent 12017 a315ded26330
child 12019 67b18844e3bb
HedgeEditor: Fix Lua error when trying to set ShoppaBalance rank without anything being selected
share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua	Wed Nov 23 13:40:06 2016 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua	Thu Apr 14 16:28:59 2016 +0200
@@ -3070,7 +3070,9 @@
 			superDelete = true
 		end
 	elseif pMode[pIndex] == loc("Selection Mode") then
-		setGearValue(sGear, "ranking", s)
+		if sGear ~= nil and GetGearType(sGear) == gtHedgehog then
+			setGearValue(sGear, "ranking", s)
+		end
 	end
 
 end