WxW: Increase wall height of left/right walls with bounce edge and no border
authorWuzzy <almikes@aol.com>
Thu, 24 Nov 2016 16:52:13 +0100
changeset 12073 e2be2e6cf544
parent 12072 18677a537d58
child 12074 b2f2ac53cbab
WxW: Increase wall height of left/right walls with bounce edge and no border
share/hedgewars/Data/Scripts/Multiplayer/WxW.lua
--- a/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua	Thu Nov 24 16:25:39 2016 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua	Thu Nov 24 16:52:13 2016 +0100
@@ -517,13 +517,28 @@
 		end
 	end
 
+	-- Border conditions
+	-- Just a wrapper for MapHasBorder()
+	local border = MapHasBorder() == true
+	-- Left and right walls are available
+	local leftRight = (WorldEdge == weBounce) or (WorldEdge == weNone and border)
+
 	local left, right, roof
-	left = {LeftX+10,TopY+10,margin,WaterLine}
-	right = {RightX-10-margin,TopY+10,margin,WaterLine}
-	roof = {LeftX+10,TopY+10,RightX-LeftX-20,margin}
 
-	local border = MapHasBorder() == true
-	local leftRight = (WorldEdge == weBounce) or (WorldEdge == weNone and border)
+	local startY, height
+	if (not border) and (WorldEdge == weBounce) then
+		-- Higher left/right walls for bouncy world edge without roof
+		local h = math.max(1024, LAND_HEIGHT)
+		height = h * 2
+		startY = TopY - h
+	else
+		-- Standard left/right wall height
+		height = WaterLine
+		startY = TopY + 10
+	end
+	left = {LeftX+10, startY, margin, height}
+	right = {RightX-10-margin, startY, margin, height}
+	roof = {LeftX+10, TopY+10, RightX-LeftX-20, margin}
 
 	if mapID ~= nil then
 		if border and MapList[mapID][3] == true then