HedgeEditor: Fix broken napalm/mine strike/drill strike
authorWuzzy <Wuzzy2@mail.ru>
Mon, 23 Oct 2017 04:35:10 +0200
changeset 12745 cae0b3139ff7
parent 12744 2f873afda0e2
child 12746 11a6d8ccf157
HedgeEditor: Fix broken napalm/mine strike/drill strike
share/hedgewars/Data/Scripts/Multiplayer/HedgeEditor.lua
--- 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