# HG changeset patch # User Periklis Ntanasis # Date 1377795045 -10800 # Node ID 749ef5bd0eafcdf7d543a1a2afc48f9dd55b436a # Parent ac522dd06f00eaef5a9f06413a72e1b503d5ab27 fixed the time adding in new hero turn diff -r ac522dd06f00 -r 749ef5bd0eaf share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua --- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua Thu Aug 29 19:36:27 2013 +0300 +++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua Thu Aug 29 19:50:45 2013 +0300 @@ -95,7 +95,6 @@ AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0) --hero ammo - AddAmmo(hero.gear, amSkip, 1) AddAmmo(hero.gear, amTeleport, 2) AddAmmo(hero.gear, amSniperRifle, 2) AddAmmo(hero.gear, amWatermelon, 2) @@ -114,7 +113,10 @@ function onNewTurn() if CurrentHedgehog == hero.gear then - TurnTimeLeft = TurnTime + timeLeft + if GetAmmoCount(hero.gear, amSkip) == 0 then + TurnTimeLeft = TurnTime + timeLeft + AddAmmo(hero.gear, amSkip, 1) + end timeLeft = 0 end turnHogs() @@ -122,14 +124,8 @@ end function onGameTick20() - --WriteLnToConsole("TURN TIME LEFT : "..timeLeft) - if CurrentHedgehog == hero.gear and GetAmmoCount(hero.gear, amSkip) == 0 then - AddAmmo(hero.gear, amSkip, 1) - --WriteLnToConsole("----- TURN TIME LEFT : "..TurnTimeLeft) + if CurrentHedgehog == hero.gear and TurnTimeLeft ~= 0 then timeLeft = TurnTimeLeft - --WriteLnToConsole("***** TURN TIME LEFT : "..timeLeft) - TurnTimeLeft = 0 - --WriteLnToConsole("NEW TURN TIME LEFT : "..timeLeft) end end