I have this right now
Every turn during Warehouse Investigation:
If the player is in the location of the guard:
Clear the screen;
Say "You decide to investigate the strange footsteps - A mistake, it seems, as a guard catches sight of you.";
Now the player is caught;
Otherwise:
Let X be the location of the guard;
Let Y be a random room adjacent to X in the Warehouse;
Move the guard to Y;
If the location is adjacent to the location of the guard:
Let way be the best route from location to the location of the guard;
Say "You hear footsteps coming from [way].";
If the location is the location of the guard:
Say "Your stomache drops as a guard walks in.";
Now the player is caught.
Which has been working fine until just now, where I got:
[** Programming error: tried to “move” guard to nothing **]
Showing the guard shows that he’s somehow entered the parking lot - which is not a room in the warehouse - which seems to be the problem, he’s stuck there now. Anyone have a clue as to what caused that?