# HG changeset patch # User Wuzzy # Date 1568648029 -7200 # Node ID 8504fee3b6015199e6c5797d594fb048e79987ae # Parent 330a2d7d520d998f6b08c3a73144e03a184d8626 Racer: Fix weird water splashes after waypoint placement Does not affect official racer, as only waypoint placement is touched. The reason was that the air attack gear sometimes was not deleted fast enough so it might occassionally drop some air bombs (these are deleted now). Also, the airplane position was set to water level, which caused another water splash. diff -r 330a2d7d520d -r 8504fee3b601 share/hedgewars/Data/Scripts/Multiplayer/Racer.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Mon Sep 16 00:31:53 2019 +0200 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Mon Sep 16 17:33:49 2019 +0200 @@ -874,9 +874,9 @@ -- airstrike detected, convert this into a potential waypoint spot if cGear ~= nil then - x,y = GetGearPosition(cGear) + local x,y = GetGearPosition(cGear) if x > -9000 then - x,y = GetGearTarget(cGear) + local x,y = GetGearTarget(cGear) if TestRectForObstacle(x-20, y-20, x+20, y+20, true) then @@ -895,7 +895,7 @@ else DeleteGear(cGear) end - SetGearPosition(cGear, -10000, 0) + SetGearPosition(cGear, -10000, y) end @@ -1021,6 +1021,10 @@ SetEffect(gear, heResurrectable, 1) elseif GetGearType(gear) == gtAirAttack then cGear = gear + local x,y = GetGearPosition(cGear) + SetGearPosition(cGear, 10000, y) + elseif (not gameBegun) and GetGearType(gear) == gtAirBomb then + DeleteGear(gear) elseif GetGearType(gear) == gtRope and TeamRope then SetTag(gear,1) SetGearValues(gear,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,GetClanColor(GetHogClan(CurrentHedgehog)))