Skip to content

Commit

Permalink
Prevent vision gifting upon saveload for campaign.
Browse files Browse the repository at this point in the history
When loading a save the human player, 0, would be given an ally's vision.

Fixes ticket:4673.
  • Loading branch information
KJeff01 committed Dec 2, 2017
1 parent c693e7c commit 8c9e726
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/visibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,11 @@ bool hasSharedVision(unsigned viewer, unsigned ally)
{
ASSERT_OR_RETURN(false, viewer < MAX_PLAYERS && ally < MAX_PLAYERS, "Bad viewer %u or ally %u.", viewer, ally);

//Do not share vision with the human player if not in multiplayer.
if (!bMultiPlayer && (viewer == 0 || ally == 0))
{
return false;
}
return viewer == ally || (bMultiPlayer && alliancesSharedVision(game.alliance) && aiCheckAlliances(viewer, ally));
}

Expand Down

0 comments on commit 8c9e726

Please sign in to comment.