Skip to content

Commit

Permalink
Merge pull request #3328 from aidatorajiro/patch-map-init
Browse files Browse the repository at this point in the history
Map: initialize screen width and height on SetupCommon
  • Loading branch information
Ghabry authored Jan 14, 2025
2 parents ea2f6c0 + 179ecbf commit 1c411e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/game_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ int Game_Map::GetMapSaveCount() {
void Game_Map::Setup(std::unique_ptr<lcf::rpg::Map> 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();
Expand Down Expand Up @@ -337,6 +334,9 @@ std::unique_ptr<lcf::rpg::Map> 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);
}
Expand Down

0 comments on commit 1c411e3

Please sign in to comment.