Skip to content

Commit 1c411e3

Browse files
authored
Merge pull request #3328 from aidatorajiro/patch-map-init
Map: initialize screen width and height on SetupCommon
2 parents ea2f6c0 + 179ecbf commit 1c411e3

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)