Space Invasion: Fix possibility to go over shield limit with param
authorWuzzy <Wuzzy2@mail.ru>
Sat, 20 Apr 2019 16:53:58 +0200
changeset 14829 f16868b40f2d
parent 14828 358d81e29a88
child 14830 cb5ffe17fdf9
Space Invasion: Fix possibility to go over shield limit with param
ChangeLog.txt
share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua
--- a/ChangeLog.txt	Sat Apr 20 16:46:07 2019 +0200
+++ b/ChangeLog.txt	Sat Apr 20 16:53:58 2019 +0200
@@ -23,6 +23,7 @@
  + The Specialists: Add script parameter support to set custom specialists order
  * Balanced Random Weapon: Fix Lua errors after using Time Box
  * Racer: Fix racer ghost not getting reset after a skip
+ * Space Invasion: No longer allow to set start shield above shield limit
  * Battalion, WxW: Crates drop between turns, when appropriate
  * Battalion: Make Sudden Death effects with the base game
  * King Mode: Fix team sometimes not being killed properly if king drowned
--- a/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Sat Apr 20 16:46:07 2019 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Sat Apr 20 16:53:58 2019 +0200
@@ -1049,7 +1049,7 @@
 		SI.startRadShots = math.floor(tonumber(params["pings"]))
 	end
 	if params["shield"] ~= nil then
-		SI.startShield = math.floor(tonumber(params["shield"]))
+		SI.startShield = math.min(250-80, math.floor(tonumber(params["shield"])))
 	end
 
 	if params["barrelbonus"] ~= nil then