HedgeEditor: Define fallback flag/voice/fort/grave when saving level data
authorWuzzy <Wuzzy2@mail.ru>
Sat, 28 Oct 2017 07:59:41 +0200
changeset 12797 8fa21750470f
parent 12796 a19ae0db7ab5
child 12798 575c0de98505
HedgeEditor: Define fallback flag/voice/fort/grave when saving level data
share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua	Sat Oct 28 07:23:53 2017 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua	Sat Oct 28 07:59:41 2017 +0200
@@ -1434,6 +1434,7 @@
 		local rgb = div(band(rgba, 0xFFFFFF00), 0x100)
 		local tColor = string.format("0x%X", rgb)
 
+		local tFort, tGrave, tFlag, tVoice
 		if getGearValue(gear,"grave") == nil then
 			tFort = GetHogFort(gear)
 			tGrave = GetHogGrave(gear)
@@ -1445,6 +1446,10 @@
 			tFlag = getGearValue(gear,"flag")
 			tVoice = getGearValue(gear,"voice")
 		end
+		if not tFort then tFort = "Castle" end
+		if not tGrave then tGrave = "Statue" end
+		if not tFlag then tFlag= "hedgewars" end
+		if not tVoice then tVoice = "Default" end
 
 		lastRecordedTeam = GetHogTeamName(gear)