Skip to content

Commit

Permalink
Experimental fix for Sokoban RandomWalking.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Karl committed Aug 6, 2011
1 parent b063ee7 commit c7c4abe
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/Analyzers/Explore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,19 @@ ExploreFocus Explore::analyzeLevel() {
ExploreFocus best;
best.rank = INT_MAX;

if (World::level().branch() == BRANCH_SOKOBAN)
return best; // There's nothing to find here
if (World::level().branch() == BRANCH_SOKOBAN) {
for (map<Point, int>::const_iterator s = World::level().symbols((unsigned char) STAIRS_UP).begin(); s != World::level().symbols((unsigned char) STAIRS_UP).end(); ++s) {
if (s->second != UNKNOWN_SYMBOL_VALUE)
continue; // we know where these stairs lead
addOption(best, RRANK_STAIR, s->first, UP, "finding endpoint of stairs up");
}
for (map<Point, int>::const_iterator s = World::level().symbols((unsigned char) STAIRS_DOWN).begin(); s != World::level().symbols((unsigned char) STAIRS_DOWN).end(); ++s) {
if (s->second != UNKNOWN_SYMBOL_VALUE)
continue; // we know where these stairs lead
addOption(best, RRANK_STAIR, s->first, DOWN, "finding endpoint of stairs down");
}
return best;
}

/* find stairs on rogue level */
if (World::level().branch() == BRANCH_ROGUE) {
Expand Down

0 comments on commit c7c4abe

Please sign in to comment.