Construction Mode: Disable setting drill strike timer in object placement mode
authorWuzzy <almikes@aol.com>
Wed, 13 Apr 2016 00:27:40 +0200
changeset 11722 f35139700d22
parent 11721 c7cdd98bb1ec
child 11723 f699978eae19
Construction Mode: Disable setting drill strike timer in object placement mode
share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua	Wed Apr 13 00:17:07 2016 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Construction_Mode.lua	Wed Apr 13 00:27:40 2016 +0200
@@ -167,6 +167,8 @@
 vTag = {}
 lastWep = nil
 
+checkForSpecialWeaponsIn = -1
+
 function HideTags()
 
 	for i = 0, 2 do
@@ -1435,6 +1437,11 @@
 		if (CurrentHedgehog ~= nil) and (TurnTimeLeft ~= TurnTime) then
 			if (lastWep ~= GetCurAmmoType()) then
 				checkForSpecialWeapons()
+			elseif checkForSpecialWeaponsIn == 0 then
+				checkForSpecialWeapons()
+				checkForSpecialWeaponsIn = -1
+			else
+				checkForSpecialWeaponsIn = checkForSpecialWeaponsIn - 1
 			end
 		end
 
@@ -1619,6 +1626,12 @@
 
 end
 
+function onTimer(key)
+
+	checkForSpecialWeaponsIn = 1
+
+end
+
 function onLeft()
 
 	pIndex = pIndex - 1