Permalink
Browse files

Maze plugin: fix bug in Maze::roomAt

It was always checking the *current cell* rather than
the cell which was passed as the argument to roomAt.
  • Loading branch information...
1 parent b09d9cb commit 32720c7117537c1a99fd3f7686ce50166b3ee99a Andrew Ayer committed Apr 24, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/gui/plugins/maze/Maze.cpp
@@ -219,10 +219,11 @@ bool Maze::isGoal(point loc) // DEPRECIATED - kept around for backwards compatib
*/
point Maze::roomAt(point curr,Direction dir){
point nowhere = {-1,-1};
- if(!validRoom(curr))
- exitWithPopup("You passed an invalid cell id to get_neighbors",nowhere);
+
+ if (!validRoom(curr))
+ exitWithPopup("You passed an invalid cell id to get_neighbors",nowhere);
- if(!validRoom(curr) || getCurrentCell()->hasWall(dir)){
+ if(getCell(curr.y, curr.x)->hasWall(dir)){
return nowhere;
}else{
point end=curr;

0 comments on commit 32720c7

Please sign in to comment.