From 891b3c0212cb1852e6db8c92696dc3b264cbbbb6 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 1 Jul 2023 04:48:04 +0300 Subject: [PATCH 16/16] Fix warning about player not providing shared vision to themselves See osdn #48311 Signed-off-by: Marko Lindqvist --- server/savegame/savegame2.c | 6 +++++- server/savegame/savegame3.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/server/savegame/savegame2.c b/server/savegame/savegame2.c index 5ea4b973ac..8905bc9174 100644 --- a/server/savegame/savegame2.c +++ b/server/savegame/savegame2.c @@ -2815,7 +2815,11 @@ static void sg_load_players(struct loaddata *loading) /* ...and check it */ players_iterate(pplayer1) { players_iterate(pplayer2) { - if (players_on_same_team(pplayer1, pplayer2)) { + /* TODO: Is there a good reason player is not marked as + * giving shared vision to themselves -> really_gives_vision() + * returning FALSE when pplayer1 == pplayer2 */ + if (pplayer1 != pplayer2 + && players_on_same_team(pplayer1, pplayer2)) { if (!really_gives_vision(pplayer1, pplayer2)) { sg_regr(3000900, _("%s did not give shared vision to team member %s."), diff --git a/server/savegame/savegame3.c b/server/savegame/savegame3.c index be9226c595..d82264ab91 100644 --- a/server/savegame/savegame3.c +++ b/server/savegame/savegame3.c @@ -3923,7 +3923,11 @@ static void sg_load_players(struct loaddata *loading) /* ...and check it */ players_iterate(pplayer1) { players_iterate(pplayer2) { - if (players_on_same_team(pplayer1, pplayer2)) { + /* TODO: Is there a good reason player is not marked as + * giving shared vision to themselves -> really_gives_vision() + * returning FALSE when pplayer1 == pplayer2 */ + if (pplayer1 != pplayer2 + && players_on_same_team(pplayer1, pplayer2)) { if (!really_gives_vision(pplayer1, pplayer2)) { sg_regr(3000900, _("%s did not give shared vision to team member %s."), -- 2.40.1