From 179ecbf8b366016e580ba7f4670a974427ab7485 Mon Sep 17 00:00:00 2001 From: aidatorajiro Date: Wed, 8 Jan 2025 03:37:03 +0900 Subject: [PATCH] Map: move width/height initialization to Game_Map::SetupCommon Otherwise the initialization is not applied when loading a Savegame Fix #3327 --- src/game_map.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game_map.cpp b/src/game_map.cpp index 6efd76765f..6d3b94378f 100644 --- a/src/game_map.cpp +++ b/src/game_map.cpp @@ -153,9 +153,6 @@ int Game_Map::GetMapSaveCount() { void Game_Map::Setup(std::unique_ptr map_in) { Dispose(); - screen_width = (Player::screen_width / 16.0) * SCREEN_TILE_SIZE; - screen_height = (Player::screen_height / 16.0) * SCREEN_TILE_SIZE; - map = std::move(map_in); SetupCommon(); @@ -337,6 +334,9 @@ std::unique_ptr Game_Map::LoadMapFile(int map_id) { } void Game_Map::SetupCommon() { + screen_width = (Player::screen_width / 16.0) * SCREEN_TILE_SIZE; + screen_height = (Player::screen_height / 16.0) * SCREEN_TILE_SIZE; + if (!Tr::GetCurrentTranslationId().empty()) { TranslateMapMessages(GetMapId(), *map); }