Skip to content

Commit 179ecbf

Browse files
torahappyGhabry
authored andcommitted
Map: move width/height initialization to Game_Map::SetupCommon
Otherwise the initialization is not applied when loading a Savegame Fix #3327
1 parent 7976386 commit 179ecbf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/game_map.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@ int Game_Map::GetMapSaveCount() {
153153
void Game_Map::Setup(std::unique_ptr<lcf::rpg::Map> map_in) {
154154
Dispose();
155155

156-
screen_width = (Player::screen_width / 16.0) * SCREEN_TILE_SIZE;
157-
screen_height = (Player::screen_height / 16.0) * SCREEN_TILE_SIZE;
158-
159156
map = std::move(map_in);
160157

161158
SetupCommon();
@@ -337,6 +334,9 @@ std::unique_ptr<lcf::rpg::Map> Game_Map::LoadMapFile(int map_id) {
337334
}
338335

339336
void Game_Map::SetupCommon() {
337+
screen_width = (Player::screen_width / 16.0) * SCREEN_TILE_SIZE;
338+
screen_height = (Player::screen_height / 16.0) * SCREEN_TILE_SIZE;
339+
340340
if (!Tr::GetCurrentTranslationId().empty()) {
341341
TranslateMapMessages(GetMapId(), *map);
342342
}

0 commit comments

Comments
 (0)