WxW, Racer: Make bots skip/auto-confirm setup phase
authorWuzzy <Wuzzy2@mail.ru>
Fri, 14 Jun 2019 17:21:05 +0200
changeset 15158 651c1737be2a
parent 15157 309aa93df110
child 15159 a344e20edfa1
WxW, Racer: Make bots skip/auto-confirm setup phase
ChangeLog.txt
share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
share/hedgewars/Data/Scripts/Multiplayer/WxW.lua
--- a/ChangeLog.txt	Fri Jun 14 17:05:00 2019 +0200
+++ b/ChangeLog.txt	Fri Jun 14 17:21:05 2019 +0200
@@ -52,6 +52,8 @@
  * HedgeEditor: Fix major FPS drop when there are a lot of objects
  * Control: Fix score failure after using extra time
  * Frenzy: Fix incorrect ammo slot numbers in ammo menu
+ * Continental supplies: Computer teams now select random continent
+ * WxW, Racer: Computer teams no longer block setup phase
 
 A Classic Fairytale:
  + Backstab: Disable utilities before traitor has been dealt with
--- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Fri Jun 14 17:05:00 2019 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua	Fri Jun 14 17:21:05 2019 +0200
@@ -866,6 +866,10 @@
                         loc("Waypoint placement phase"), infoString, -amAirAttack, 4000)
                         AddAmmo(CurrentHedgehog, amAirAttack, 4000)
                         SetWeapon(amAirAttack)
+                        -- Bots skip waypoint placement
+                        if GetHogLevel(CurrentHedgehog) ~= 0 then
+                                SkipTurn()
+                        end
                 end
         end
 
--- a/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua	Fri Jun 14 17:05:00 2019 +0200
+++ b/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua	Fri Jun 14 17:21:05 2019 +0200
@@ -977,7 +977,7 @@
 	AddCaption(loc("Please place your hedgehog first!"), msgColorWarn, capgrpMessage2)
 end
 
-function onLJump()
+function AcceptConfiguration()
 	if roundN == 1 then
 		PlaySound(sndPlaced)
 		SetInputMask(0xFFFFFFFF)
@@ -1001,6 +1001,12 @@
 		end
 		PlaySound(sndYesSir, CurrentHedgehog)
 		FinalizeMenu()
+	end
+end
+
+function onLJump()
+	if roundN == 1 then
+		AcceptConfiguration()
 	elseif roundN == 2 then
 		PlaceWarn()
 	elseif roundN == 100 then
@@ -1363,6 +1369,9 @@
 		UpdateMenu()
 		AddCaption(string.format(loc("%s may choose the rules."), GetHogTeamName(CurrentHedgehog)), msgColorTech, capgrpGameState)
 		HandleStartingStage()
+		if GetHogLevel(CurrentHedgehog) ~= 0 then
+			AcceptConfiguration()
+		end
 	end
 
 end