Skip to content

Commit

Permalink
Map: move width/height initialization to Game_Map::SetupCommon
Browse files Browse the repository at this point in the history
Otherwise the initialization is not applied when loading a Savegame

Fix #3327
  • Loading branch information
aidatorajiro authored and Ghabry committed Jan 14, 2025
1 parent 7976386 commit 179ecbf
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 179ecbf

Please sign in to comment.