Skip to content

Commit 81ae873

Browse files
authored
Merge branch 'development' into effectalwaysshows
2 parents 903e6b3 + 8b25566 commit 81ae873

File tree

5 files changed

+47
-19
lines changed

5 files changed

+47
-19
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
99
<details><summary><b>Added</b></summary>
1010

1111
- Exposed `MovableObject` INI property `EffectAlwaysShows` to Lua (R/W), boolean.
12+
13+
<details><summary><b>Changed</b></summary>
14+
15+
- Brain vs Brain now uses the Infantry Brain preset if available, and picks a random brain if not.
1216

1317
</details>
1418

1519
<details><summary><b>Fixed</b></summary>
1620

21+
- Fixed `UseSupportOffsetWhileReloading` defaulting to true instead of false
22+
1723
- Fixed regression introduced in 6.1 causing Conquest activities to immediately fail if a defending brain was present (and probably breaking other activities as well).
1824

1925
- Fixed the Conquest start game menu not letting you immediately start a game until you tweak some settings.
2026

27+
- Fixed One Man Army (and Diggers Only) assigning a player to the winning team instead of a team.
28+
2129
</details>
2230

2331
## [Release v6.2.1] - 2024/02/21

Data/Base.rte/Activities/BrainVsBrain.lua

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,25 @@ function BrainvsBrain:StartNewGame()
125125
local foundBrain = MovableMan:GetUnassignedBrain(self:GetTeamOfPlayer(player));
126126
-- Spawn a brain if we can't find an unassigned brain in the scene to give each player
127127
if not foundBrain then
128-
local Brain = RandomAHuman("Brains", self:GetTeamTech(self:GetTeamOfPlayer(player)));
129-
if Brain then
130-
local Weapon = RandomHDFirearm("Weapons - Primary", self:GetTeamTech(self:GetTeamOfPlayer(player)));
131-
if Weapon then
132-
Brain:AddInventoryItem(Weapon);
128+
local techID = PresetMan:GetModuleID(self:GetTeamTech(self:GetTeamOfPlayer(player)));
129+
local Brain;
130+
if techID ~= -1 then
131+
Brain = PresetMan:GetLoadout("Infantry Brain", techID, false);
132+
if Brain then
133+
Brain:RemoveInventoryItem("Constructor");
134+
end
135+
end
136+
if not Brain then
137+
Brain = RandomAHuman("Brains", techID);
138+
if Brain then
139+
local Weapon = RandomHDFirearm("Weapons - Primary", self:GetTeamTech(self:GetTeamOfPlayer(player)));
140+
if Weapon then
141+
Brain:AddInventoryItem(Weapon);
142+
end
133143
end
144+
end
134145

146+
if Brain then
135147
Brain.AIMode = Actor.AIMODE_SENTRY;
136148
Brain.Team = self:GetTeamOfPlayer(player);
137149

@@ -192,13 +204,24 @@ function BrainvsBrain:StartNewGame()
192204
self:SetTeamFunds(self:GetStartingGold()*(self.Difficulty/100+0.5), self.CPUTeam);
193205
self.bombChance = math.random(self.Difficulty*0.7, self.Difficulty) / 120;
194206

195-
self.CPUBrain = CreateAHuman("Brain Robot", "Base.rte");
196-
if self.CPUBrain then
197-
local Weapon = CreateHDFirearm("SMG", "Base.rte");
198-
if Weapon then
199-
self.CPUBrain:AddInventoryItem(Weapon);
207+
local techID = PresetMan:GetModuleID(self:GetTeamTech(self.CPUTeam));
208+
if techID ~= -1 then
209+
self.CPUBrain = PresetMan:GetLoadout("Infantry Brain", techID, false);
210+
if self.CPUBrain then
211+
self.CPUBrain:RemoveInventoryItem("Constructor");
200212
end
213+
end
214+
if not self.CPUBrain then
215+
self.CPUBrain = RandomAHuman("Brains", techID);
216+
if self.CPUBrain then
217+
local Weapon = CreateHDFirearm("SMG", "Base.rte");
218+
if Weapon then
219+
self.CPUBrain:AddInventoryItem(Weapon);
220+
end
221+
end
222+
end
201223

224+
if self.CPUBrain then
202225
self.CPUBrain.AIMode = Actor.AIMODE_SENTRY;
203226
self.CPUBrain.Team = self.CPUTeam;
204227

Data/Base.rte/Activities/OneManArmy.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ end
255255

256256
function OneManArmy:UpdateActivity()
257257
if self.ActivityState ~= Activity.OVER then
258-
ActivityMan:GetActivity():SetTeamFunds(0, 0);
258+
ActivityMan:GetActivity():SetTeamFunds(0, Activity.TEAM_1);
259259
for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do
260260
if self:PlayerActive(player) and self:PlayerHuman(player) then
261261
--Display messages
@@ -285,7 +285,7 @@ function OneManArmy:UpdateActivity()
285285
FrameMan:ClearScreenText(self:ScreenOfPlayer(player));
286286
FrameMan:SetScreenText("You survived!", self:ScreenOfPlayer(player), 333, -1, false);
287287

288-
self.WinnerTeam = player;
288+
self.WinnerTeam = team;
289289

290290
--Kill all enemies
291291
for actor in MovableMan.Actors do

Data/Base.rte/Activities/OneManArmyDiggers.lua

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ end
219219

220220
function OneManArmy:UpdateActivity()
221221
if self.ActivityState ~= Activity.OVER then
222-
ActivityMan:GetActivity():SetTeamFunds(0,0);
222+
ActivityMan:GetActivity():SetTeamFunds(0, Activity.TEAM_1);
223223
for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do
224224
if self:PlayerActive(player) and self:PlayerHuman(player) then
225225
--Display messages.
@@ -229,7 +229,6 @@ function OneManArmy:UpdateActivity()
229229
FrameMan:SetScreenText("Survive for " .. self.timeDisplay .. "!", self:ScreenOfPlayer(player), 333, 5000, true);
230230
end
231231

232-
-- The current player's team
233232
local team = self:GetTeamOfPlayer(player);
234233
-- Check if any player's brain is dead
235234
if not MovableMan:IsActor(self:GetPlayerBrain(player)) then
@@ -242,8 +241,6 @@ function OneManArmy:UpdateActivity()
242241
self.WinnerTeam = self:OtherTeam(team);
243242
ActivityMan:EndActivity();
244243
end
245-
else
246-
self.HuntPlayer = player;
247244
end
248245

249246
--Check if the player has won.
@@ -252,7 +249,7 @@ function OneManArmy:UpdateActivity()
252249
FrameMan:ClearScreenText(self:ScreenOfPlayer(player));
253250
FrameMan:SetScreenText("You survived!", self:ScreenOfPlayer(player), 333, -1, false);
254251

255-
self.WinnerTeam = player;
252+
self.WinnerTeam = team;
256253

257254
--Kill all enemies.
258255
for actor in MovableMan.Actors do
@@ -363,4 +360,4 @@ function OneManArmy:UpdateActivity()
363360
self.enemySpawnTimeLimit = (self.baseSpawnTime + math.random(self.baseSpawnTime) * rte.SpawnIntervalScale);
364361
end
365362
end
366-
end
363+
end

Source/Entities/HeldDevice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void HeldDevice::Clear() {
4040
m_Supported = false;
4141
m_SupportAvailable = false;
4242
m_SupportOffset.Reset();
43-
m_UseSupportOffsetWhileReloading = true;
43+
m_UseSupportOffsetWhileReloading = false;
4444
m_SeenByPlayer.fill(false);
4545
m_IsUnPickupable = false;
4646
m_PickupableByPresetNames.clear();

0 commit comments

Comments
 (0)