Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not override saved camera position in skirmish saves #3558

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,8 @@ bool stageThreeInitialise()

if (bMultiPlayer)
{
playerResponding(); // say howdy!
cameraToHome(selectedPlayer, false, fromSave);
playerResponding(); // say howdy!
if (NetPlay.bComms && !NETisReplay())
{
multiStartScreenInit();
Expand Down
3 changes: 0 additions & 3 deletions src/multiopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,6 @@ void playerResponding()
ingame.JoiningInProgress[selectedPlayer] = false;
}

// Home the camera to the player
cameraToHome(selectedPlayer, false);

// Tell the world we're here
NETbeginEncode(NETbroadcastQueue(), NET_PLAYERRESPONDING);
NETuint32_t(&selectedPlayer);
Expand Down
6 changes: 3 additions & 3 deletions src/multiplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ bool multiplayerWinSequence(bool firstCall)

if (firstCall)
{
pos = cameraToHome(selectedPlayer, true); // pan the camera to home if not already doing so
pos = cameraToHome(selectedPlayer, true, false); // pan the camera to home if not already doing so
last = 0;

// stop all research
Expand Down Expand Up @@ -657,7 +657,7 @@ int scavengerPlayer()

// ////////////////////////////////////////////////////////////////////////////
// probably temporary. Places the camera on the players 1st droid or struct.
Vector3i cameraToHome(UDWORD player, bool scroll)
Vector3i cameraToHome(UDWORD player, bool scroll, bool fromSave)
{
UDWORD x, y;
STRUCTURE *psBuilding = nullptr;
Expand Down Expand Up @@ -693,7 +693,7 @@ Vector3i cameraToHome(UDWORD player, bool scroll)
{
requestRadarTrack(world_coord(x), world_coord(y));
}
else
else if (!fromSave) // This will override the saved camera position in skirmish games if not checked
{
setViewPos(x, y, true);
}
Expand Down
2 changes: 1 addition & 1 deletion src/multiplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ int whosResponsible(int player);
bool canGiveOrdersFor(int player, int playerInQuestion);
int scavengerSlot(); // Returns the player number that scavengers would have if they were enabled.
int scavengerPlayer(); // Returns the player number that the scavengers have, or -1 if disabled.
Vector3i cameraToHome(UDWORD player, bool scroll);
Vector3i cameraToHome(UDWORD player, bool scroll, bool fromSave);

bool multiPlayerLoop(); // for loop.c

Expand Down
Loading