share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua
branchspacecampaign
changeset 9582 bf314b2258b3
parent 9578 16139270448f
child 9620 55c82fd210cb
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua	Mon Aug 26 06:23:19 2013 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua	Tue Aug 27 01:25:46 2013 +0300
@@ -95,9 +95,7 @@
 	Theme = "Desert"
 	
 	-- get the check point
-	if tonumber(GetCampaignVar("Desert01CheckPoint")) then
-		checkPointReached = tonumber(GetCampaignVar("Desert01CheckPoint"))
-	end
+	checkPointReached = initCheckpoint("desert01")
 	-- get hero health
 	local heroHealth = 100
 	if checkPointReached > 1 and tonumber(GetCampaignVar("HeroHealth")) then
@@ -378,17 +376,17 @@
 end
 
 function heroAtCheckpoint2(gear)
-	saveCheckPoint("2")
+	saveCheckPointLocal("2")
 	secondBattle()
 end
 
 function heroAtCheckpoint3(gear)
-	saveCheckPoint("3")
+	saveCheckPointLocal("3")
 	secondBattle()
 end
 
 function heroAtCheckpoint4(gear)
-	saveCheckPoint("4")
+	saveCheckPointLocal("4")
 end
 
 function heroAtThirdBattle(gear)
@@ -407,7 +405,7 @@
 function checkForWin2(gear)
 	-- ok lets place one more checkpoint as next part seems challenging without rope
 	if cratesFound ==  0 then
-		saveCheckPoint("5")
+		saveCheckPointLocal("5")
 	end
 	
 	checkForWin()	
@@ -463,9 +461,9 @@
 	TurnTimeLeft = 0
 end
 
-function saveCheckPoint(cpoint)
+function saveCheckPointLocal(cpoint)
 	-- save checkpoint
-	SaveCampaignVar("Desert01CheckPoint", cpoint)	
+	saveCheckpoint(cpoint)	
 	SaveCampaignVar("HeroHealth", GetHealth(hero.gear))
 	-- bazooka - grenade - rope - parachute - deagle - btorch - construct - portal
 	SaveCampaignVar("HeroAmmo", GetAmmoCount(hero.gear, amBazooka)..GetAmmoCount(hero.gear, amGrenade)..