# HG changeset patch # User nemo # Date 1508870184 14400 # Node ID c7224d202e8bad3fe737a39135cdbb4e68ff3da4 # Parent 327f71313e04f483685c6da3449907ed8051be49 2nd try... just shortcircuit most of onGameTick20 when we are between turns. diff -r 327f71313e04 -r c7224d202e8b share/hedgewars/Data/Maps/ClimbHome/map.lua --- a/share/hedgewars/Data/Maps/ClimbHome/map.lua Tue Oct 24 14:14:00 2017 -0400 +++ b/share/hedgewars/Data/Maps/ClimbHome/map.lua Tue Oct 24 14:36:24 2017 -0400 @@ -49,6 +49,7 @@ local multiplayerVictoryDelay = -1 local multiplayerWinningHogs = {} local multiplayerWins = 0 +local racing = false -- Placement positions of winning hogs local victoryPosses = { } @@ -117,6 +118,7 @@ elseif GetGearType(gear) == gtHedgehog then onGameTick20() onGearDamage(gear, 0) + ready = false HH[gear] = nil end end @@ -251,10 +253,6 @@ function onGameTick20() local x,y - if gameTime - startTime < 40 then - return - end - if math.random(20) == 1 then AddVisualGear(2012,56,vgtSmoke,0,false) end if CurrentHedgehog == dummyHog and dummySkip ~= 0 and dummySkip < GameTime then ParseCommand("/skip") @@ -281,6 +279,10 @@ --end end + if not ready then + return + end + -- This will be executed if a player reached home in multiplayer if multiplayerVictoryDelay > 0 then multiplayerVictoryDelay = multiplayerVictoryDelay - 20 @@ -417,6 +419,7 @@ if distanceFromWater < 0 and not YouLost and not YouWon then makeSinglePlayerLoserStats() YouLost = true + ready = false end -- FIXME: Hog is also in winning box if it just walks into the chair from the left, touching it. Intentional? if not YouWon and not YouLost and gearIsInBox(CurrentHedgehog, 1920, 252, 50, 50) then @@ -437,12 +440,14 @@ EndGame() onAchievementsDeclaration() YouWon = true + ready = false end else if distanceFromWater < 0 and not YouLost and not YouWon then makeMultiPlayerLoserStat(CurrentHedgehog) deadHedgehogs = deadHedgehogs + 1 YouLost = true + ready = false if deadHedgehogs >= totalHedgehogs then makeFinalMultiPlayerStats() EndGame() @@ -466,6 +471,7 @@ -- TODO: Add stupid winner grin. multiplayerVictoryDelay = 4000 YouWon = true + ready = false end end @@ -627,6 +633,7 @@ end end YouLost = true + ready = false end end