# HG changeset patch # User nemo # Date 1510168366 18000 # Node ID b986a8b8cd569e5a44a6bf53fb35d439411a279f # Parent c75781937859f126ea55bb226b3f2c7193306dc7 just merging if statements diff -r c75781937859 -r b986a8b8cd56 share/hedgewars/Data/Maps/ClimbHome/map.lua --- a/share/hedgewars/Data/Maps/ClimbHome/map.lua Mon Nov 06 22:26:54 2017 +0100 +++ b/share/hedgewars/Data/Maps/ClimbHome/map.lua Wed Nov 08 14:12:46 2017 -0500 @@ -308,20 +308,22 @@ end end - if CurrentHedgehog ~= nil then x,y = GetGearPosition(CurrentHedgehog) end - if Cake ~= nil and CurrentHedgehog ~= nil then - local cx,cy = GetGearPosition(Cake) - if y < cy-1500 then - DeleteGear(Cake) - Cake = nil + if CurrentHedgehog ~= nil then + x,y = GetGearPosition(CurrentHedgehog) + if Cake ~= nil then + local cx,cy = GetGearPosition(Cake) + if y < cy-1500 then + DeleteGear(Cake) + Cake = nil + end + + if GetHealth(Cake) < 999980 and gearIsInCircle(CurrentHedgehog,cx,cy,450) then + FireBoom(cx,cy,200) -- todo animate + DeleteGear(Cake) + Cake = nil + end end - - if Cake ~= nil and GetHealth(Cake) < 999980 and gearIsInCircle(CurrentHedgehog,cx,cy,450) then - FireBoom(cx,cy,200) -- todo animate - DeleteGear(Cake) - Cake = nil - end - end + end if CurrentHedgehog ~= nil and band(GetState(CurrentHedgehog),gstHHDriven) == 0 then for f,i in pairs(Fire) do -- takes too long to fall otherwise