Maze scripts now work reliably.

This commit is contained in:
Zed A. Shaw 2026-03-13 10:41:42 -04:00
parent c615f4fc1e
commit 9001af214a
3 changed files with 27 additions and 22 deletions

View file

@ -289,7 +289,7 @@ namespace maze {
matrix::perimeter it{room.x - 1, room.y - 1, room.width + 2, room.height + 2};
while(it.next()) {
if($walls[it.y][it.x] == SPACE_VALUE) {
if(matrix::inbounds($walls, it.x, it.y) && $walls[it.y][it.x] == SPACE_VALUE) {
last_door = {it.x, it.y};
possible_doors++;
}
@ -458,7 +458,6 @@ namespace maze {
for(auto& action : config) {
std::string aname = action["action"];
fmt::println("ACTION {}", aname);
if(aname == "hunt_and_kill") {
maze.hunt_and_kill();