Skip to content

Commit

Permalink
fix(zq): avoid overwriting screen bookmarks on quest load
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyV99 committed Apr 3, 2024
1 parent c71f993 commit 771f801
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/zq/zq_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6733,6 +6733,25 @@ int32_t load_quest(const char *filename, bool show_progress)
Map.clear();
Map.setCurrMap(vbound(zinit.last_map,0,map_count-1));
Map.setCurrScr(zinit.last_screen);
extern int32_t current_mappage;
current_mappage = 0;
bool found_default = false;
for(int q = 0; q < MAX_MAPPAGE_BTNS; ++q)
{
auto &pg = map_page[q];
if(pg.map == Map.getCurrMap() && pg.screen == Map.getCurrScr())
{
current_mappage = q;
break;
}
else if(found_default || pg.map > 1 || (pg.map == 1 && pg.screen > 0))
continue;
else
{
current_mappage = q;
found_default = true;
}
}
refresh(rALL);
refresh_pal();
set_rules(quest_rules);
Expand Down Expand Up @@ -6790,6 +6809,25 @@ int32_t load_tileset(const char *filename, dword tsetflags)
Map.clear();
Map.setCurrMap(vbound(zinit.last_map,0,map_count-1));
Map.setCurrScr(zinit.last_screen);
extern int32_t current_mappage;
current_mappage = 0;
bool found_default = false;
for(int q = 0; q < MAX_MAPPAGE_BTNS; ++q)
{
auto &pg = map_page[q];
if(pg.map == Map.getCurrMap() && pg.screen == Map.getCurrScr())
{
current_mappage = q;
break;
}
else if(found_default || pg.map > 1 || (pg.map == 1 && pg.screen > 0))
continue;
else
{
current_mappage = q;
found_default = true;
}
}
refresh(rALL);
refresh_pal();
set_rules(quest_rules);
Expand Down

0 comments on commit 771f801

Please sign in to comment.