share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
changeset 12740 cae0b3139ff7
parent 12648 c755afd8fb6b
child 12791 a19ae0db7ab5
--- a/share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua	Mon Oct 23 03:01:10 2017 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua	Mon Oct 23 04:35:10 2017 +0200
@@ -2973,7 +2973,8 @@
 
 		x,y = GetGearTarget(cGear)
 
-		if GetGearType(cGear) == gtAirAttack then
+		AddCaption(GetGearPos(cGear))
+		if GetGearType(cGear) == gtAirAttack and GetCurAmmoType() == amAirAttack then
 			DeleteGear(cGear)
 			PlaceObject(x, y)
 		elseif GetGearType(cGear) == gtGirder then
@@ -3716,7 +3717,7 @@
 		end
 	end
 
-	if (GetGearType(gear) == gtAirAttack) or (GetGearType(gear) == gtGirder) then
+	if (GetGearType(gear) == gtAirAttack and GetCurAmmoType() == amAirAttack) or (GetGearType(gear) == gtGirder) then
 		cGear = gear
 	end
 
@@ -3768,7 +3769,7 @@
 		ufoGear = nil
 	end
 
-	if gt == gtAirAttack or gt == gtGirder then
+	if (gt == gtAirAttack and GetGearPos(gear) == 0) or gt == gtGirder then
 		cGear = nil
 	end