Skip to content

Commit

Permalink
fix bug in reselecting modes
Browse files Browse the repository at this point in the history
  • Loading branch information
Not-A-Normal-Robot committed May 16, 2024
1 parent d2d3a0c commit 1a38f38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ import * as LANG from "./lang.js";
CROSSHAIR.style.display = "block";
moveMap(dx, dy);
const modeAtCenter = getModeAtScreenCenter();
if(modeAtCenter) {
if(modeAtCenter && selected !== modeAtCenter) {
selectMode(modeAtCenter.name);
}
}
Expand Down Expand Up @@ -415,7 +415,7 @@ import * as LANG from "./lang.js";
modeInfoExpandFull();
return;
}

if(selected) {
document.getElementById(MODE_ID_PREFIX + selected)?.classList.remove("selected");
}
Expand Down

0 comments on commit 1a38f38

Please sign in to comment.