Permalink
Browse files

Prevent vision gifting upon saveload for campaign.

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 8c9e7260333d6388438a091aad493bd2e11a965e
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/visibility.cpp
View
@@ -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));
}

0 comments on commit 8c9e726

Please sign in to comment.