Skip to content

Commit 17577b0

Browse files
committed
Fix regression added in #99 that prevented enemies from spawning.
Apparently I got distracted partway through and forgot what I was doing, because I only got rid of the last reference to the now-removed loop variable `i` in Harvester and KeepieUppie, leaving Massacre, OneManArmy, OneManArmyDiggers, and Survival broken. Whoops!
1 parent 4f85571 commit 17577b0

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1010

1111
- Fixed Constructor auto-cancelling build mode if you actively selected the "Order Construction" pie menu option.
1212

13+
- Fixed regression introduced in v6.2.0 preventing Massacre, One-Man Army, One-Man Army (Diggers Only), and Survival from spawning enemies at all.
14+
1315
</details>
1416

1517
## [Release v6.2.0] - 2024/02/19

Data/Base.rte/Activities/Massacre.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ function Massacre:UpdateActivity()
301301
for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do
302302
if self:PlayerActive(player) and self:PlayerHuman(player) then
303303
local sceneChunk = SceneMan.SceneWidth / 3;
304-
local checkPos = self:GetPlayerBrain(i - 1).Pos.X + (SceneMan.SceneWidth/2) + ( (sceneChunk/2) - (math.random()*sceneChunk) );
304+
local checkPos = self:GetPlayerBrain(player).Pos.X + (SceneMan.SceneWidth/2) + ( (sceneChunk/2) - (math.random()*sceneChunk) );
305305
if checkPos > SceneMan.SceneWidth then
306306
checkPos = checkPos - SceneMan.SceneWidth;
307307
elseif checkPos < 0 then

Data/Base.rte/Activities/OneManArmy.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ function OneManArmy:UpdateActivity()
382382
for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do
383383
if self:PlayerActive(player) and self:PlayerHuman(player) then
384384
local sceneChunk = SceneMan.SceneWidth * 0.3;
385-
local checkPos = self:GetPlayerBrain(i - 1).Pos.X + (SceneMan.SceneWidth * 0.5) + ((sceneChunk * 0.5) - (math.random() * sceneChunk));
385+
local checkPos = self:GetPlayerBrain(player).Pos.X + (SceneMan.SceneWidth * 0.5) + ((sceneChunk * 0.5) - (math.random() * sceneChunk));
386386
if checkPos > SceneMan.SceneWidth then
387387
checkPos = checkPos - SceneMan.SceneWidth;
388388
elseif checkPos < 0 then

Data/Base.rte/Activities/OneManArmyDiggers.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ function OneManArmy:UpdateActivity()
325325
for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do
326326
if self:PlayerActive(player) and self:PlayerHuman(player) then
327327
local sceneChunk = SceneMan.SceneWidth / 3;
328-
local checkPos = self:GetPlayerBrain(i - 1).Pos.X + (SceneMan.SceneWidth/2) + ( (sceneChunk/2) - (math.random()*sceneChunk) );
328+
local checkPos = self:GetPlayerBrain(player).Pos.X + (SceneMan.SceneWidth/2) + ( (sceneChunk/2) - (math.random()*sceneChunk) );
329329
if checkPos > SceneMan.SceneWidth then
330330
checkPos = checkPos - SceneMan.SceneWidth;
331331
elseif checkPos < 0 then

Data/Base.rte/Activities/Survival.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ function Survival:UpdateActivity()
279279
for player = Activity.PLAYER_1, Activity.MAXPLAYERCOUNT - 1 do
280280
if self:PlayerActive(player) and self:PlayerHuman(player) then
281281
local sceneChunk = SceneMan.SceneWidth / 3;
282-
local checkPos = self:GetPlayerBrain(i - 1).Pos.X + (SceneMan.SceneWidth/2) + ( (sceneChunk/2) - (math.random()*sceneChunk) );
282+
local checkPos = self:GetPlayerBrain(player).Pos.X + (SceneMan.SceneWidth/2) + ( (sceneChunk/2) - (math.random()*sceneChunk) );
283283
if checkPos > SceneMan.SceneWidth then
284284
checkPos = checkPos - SceneMan.SceneWidth;
285285
elseif checkPos < 0 then

0 commit comments

Comments
 (0)