Highlander: Fix hogs receiving air strikes in maps with border
authorWuzzy <Wuzzy2@mail.ru>
Mon, 26 Nov 2018 01:13:10 +0100
changeset 14317 0855344f54a7
parent 14316 fd8e0e52d5bd
child 14318 a6c5ce147530
Highlander: Fix hogs receiving air strikes in maps with border
ChangeLog.txt
share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua
--- a/ChangeLog.txt	Mon Nov 26 02:50:54 2018 +0300
+++ b/ChangeLog.txt	Mon Nov 26 01:13:10 2018 +0100
@@ -97,6 +97,7 @@
 
 Highlander:
  * Fix all hogs receiving a free teleport after hog placement phase
+ * Fix hogs receiving air strikes in maps with border
 
 Racer/TechRacer:
  * Fix rare bug in TechRacer causing crates and other objects to not appear on start of turn
--- a/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua	Mon Nov 26 02:50:54 2018 +0300
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua	Mon Nov 26 01:13:10 2018 +0100
@@ -23,9 +23,7 @@
 HedgewarsScriptLoad("/Scripts/Tracker.lua")
 HedgewarsScriptLoad("/Scripts/Params.lua")
 
--- These define weps allowed by the script.
--- These were arbitrarily defined out-of-order in initial script, so that was preserved here, resulting 
--- in a moderately odd syntax.
+-- These define weapons allowed by the script.
 local atkWeps = {
 	[amBazooka]=true, [amBee]=true, [amMortar]=true, [amDrill]=true, [amSnowball]=true,
 	[amGrenade]=true, [amClusterBomb]=true, [amMolotov]=true, [amWatermelon]=true,
@@ -259,6 +257,30 @@
 end
 
 function onGameStart()
+	-- Remove air strikes in maps with border
+	if MapHasBorder() or GetGameFlag(gfBorder) then
+		atkWeps[amAirAttack] = nil
+		atkWeps[amMineStrike] = nil
+		atkWeps[amNapalm] = nil
+		atkWeps[amDrillStrike] = nil
+		atkWeps[amPiano] = nil
+	end
+	-- Disable redundant utilities
+	if GetGameFlag(gfVampiric) then
+		utilWeps[amVampiric] = nil
+	end
+	if GetGameFlag(gfLowGravity) then
+		utilWeps[amLowGravity] = nil
+	end
+	if GetGameFlag(gfLaserSight) then
+		utilWeps[amLaserSight] = nil
+	end
+	if GetGameFlag(gfInvulnerable) then
+		utilWeps[amInvulnerable] = nil
+	end
+	if TurnTime > 999000 then
+		utilWeps[amExtraTime] = nil
+	end
 	utilChoices[amSkip] = 0
 	local c = 0
 	for i = 0, AmmoTypeMax do