Skip to content

Commit 67a8a7a

Browse files
committed
Avoid saving remote pictures from players with ID < 2
The relaxed offset was introduced in 44af062, but the issue it was intended to fix (non-remote pictures not getting saved) seems to have been caused by something else, possibly the uninitialized idx variable.
1 parent 784c42f commit 67a8a7a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/game_pictures.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,8 @@ std::vector<lcf::rpg::SavePicture> Game_Pictures::GetSaveData() const {
103103
// but in multiplayer we don't want to save pictures generated by other players
104104
// because 1) they occupy needless space and 2) they will be immediately out of date
105105
constexpr int min_pic_id = 1;
106-
constexpr int min_player_id = 1;
107-
// the 50 comes from the player image offset used for remote ShowPicture commands
108-
const int multiplayer_pic_ids_begin = data_size + min_pic_id + (min_player_id + 1) * 50;
106+
constexpr int min_player_id = 0;
107+
const int multiplayer_pic_ids_begin = GetPictureIdForPlayer(min_player_id, min_pic_id);
109108
save.reserve(multiplayer_pic_ids_begin);
110109

111110
for (const auto& pic: pictures) {

0 commit comments

Comments
 (0)