fixed the bug that didn't saved checkpoint 1 reported by mikade spacecampaign
authorPeriklis Ntanasis <pntanasis@gmail.com>
Thu, 12 Sep 2013 18:26:06 +0300
branchspacecampaign
changeset 9616 df14425d9e4c
parent 9615 86b82816b222
child 9617 662956a081a0
fixed the bug that didn't saved checkpoint 1 reported by mikade
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua	Thu Sep 12 03:49:53 2013 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua	Thu Sep 12 18:26:06 2013 +0300
@@ -186,7 +186,6 @@
 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
 	AddEvent(onProfessorDeath, {professor.gear}, professorDeath, {professor.gear}, 0)
 	AddEvent(onMinionsDeath, {professor.gear}, minionsDeath, {professor.gear}, 0)
-	AddEvent(onBattleZone, {hero.gear}, battleZone, {hero.gear}, 0)
 	AddEvent(onProfessorHit, {professor.gear}, professorHit, {professor.gear}, 1)
 
 	if checkPointReached == 1 then
@@ -209,6 +208,8 @@
 		TurnTimeLeft = 0
 		AddAnim(dialog02)
 	end
+	-- this event check goes here to be executed after the onWeaponsPlatform check
+	AddEvent(onBattleZone, {hero.gear}, battleZone, {hero.gear}, 0)
 	
 	SendHealthStatsOff()
 end
@@ -267,8 +268,8 @@
 -------------- EVENTS ------------------
 
 function onWeaponsPlatform(gear)
-	if not hero.dead and GetX(gear) > bazookaX-200 and GetX(gear) < deserteagleX+400  
-		and GetY(gear) < weaponsY+150 and StoppedGear(gear) then
+	if not hero.dead and (GetAmmoCount(hero.gear, amBazooka) > 0 or GetAmmoCount(hero.gear, amParachute) > 0 or 
+			GetAmmoCount(hero.gear, amGrenade) > 0 or GetAmmoCount(hero.gear, amDEagle) > 0) and StoppedGear(hero.gear) then
 		return true
 	end
 	return false
@@ -323,7 +324,10 @@
 	weaponsAqcuired = true
 	SetWind(60)		
 	GameFlags = bor(GameFlags,gfDisableWind)
-	AddAnim(dialog02)
+	AddAmmo(hero.gear, amRope, 0)
+	if GetX(hero.gear) < 1900 then
+		AddAnim(dialog02)
+	end
 end
 
 function heroDeath(gear)