Skip to content

Commit fe4cb82

Browse files
committed
Decision Day camera fixes when player 1 isn't present.
Decision Day now scrolls each player's camera to their own brainbot instead of the first player's brainbot, which (as per usual) broke if player 1 wasn't present.
1 parent 2ab3fef commit fe4cb82

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Data/Missions.rte/Activities/DecisionDay.lua

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,10 +1006,7 @@ function DecisionDay:UpdateCamera()
10061006
local scrollTargetAndSpeed;
10071007
if self.currentStage <= self.stages.showInitialText then
10081008
if self.currentStage == self.stages.showInitialText and self.messageTimer.SimTimeLimitProgress > 0.75 then
1009-
local brain = self:GetPlayerBrain(0);
1010-
if brain then
1011-
scrollTargetAndSpeed = {brain.Pos, fastScroll};
1012-
end
1009+
scrollTargetAndSpeed = {nil, fastScroll};
10131010
else
10141011
local dropShipToFollow = #self.initialDropShipsAndVelocities > 0 and self.initialDropShipsAndVelocities[1].dropShip or nil;
10151012
if dropShipToFollow then
@@ -1101,7 +1098,14 @@ function DecisionDay:UpdateCamera()
11011098

11021099
if scrollTargetAndSpeed then
11031100
for _, player in pairs(self.humanPlayers) do
1104-
CameraMan:SetScrollTarget(scrollTargetAndSpeed[1], scrollTargetAndSpeed[2], player);
1101+
if not scrollTargetAndSpeed[1] then
1102+
brain = self:GetPlayerBrain(player)
1103+
if brain then
1104+
CameraMan:SetScrollTarget(brain.pos, scrollTargetAndSpeed[2], player)
1105+
end
1106+
else
1107+
CameraMan:SetScrollTarget(scrollTargetAndSpeed[1], scrollTargetAndSpeed[2], player);
1108+
end
11051109
end
11061110
end
11071111
self.cameraIsPanning = scrollTargetAndSpeed ~= nil;

0 commit comments

Comments
 (0)