File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed
Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -503,16 +503,22 @@ void zmap::setCurrentView(int32_t map, int32_t scr)
503503
504504void zmap::setCurrMap (int32_t index)
505505{
506- int32_t oldmap=currmap;
507- scrpos[currmap]=currscr;
508- currmap=bound (index,0 ,map_count);
509- screens=&TheMaps[currmap*MAPSCRS];
510-
511- currscr=scrpos[currmap];
512- loadlvlpal (getcolor ());
513-
514- reset_combo_animations2 ();
515- mmap_mark_dirty ();
506+ int32_t oldmap=currmap;
507+ optional<int > oldcolor;
508+ if (screens)
509+ oldcolor = getcolor ();
510+ scrpos[currmap]=currscr;
511+ currmap=bound (index,0 ,map_count);
512+ screens=&TheMaps[currmap*MAPSCRS];
513+
514+ currscr=scrpos[currmap];
515+ int newcolor = getcolor ();
516+ loadlvlpal (newcolor);
517+ if (!oldcolor || *oldcolor != newcolor)
518+ rebuild_trans_table ();
519+
520+ reset_combo_animations2 ();
521+ mmap_mark_dirty ();
516522}
517523
518524int32_t zmap::getCurrScr ()
You can’t perform that action at this time.
0 commit comments