Minor tweakign to message handling for stair commands
authorMartin Read <mpread@chiark.greenend.org.uk>
Mon, 10 Mar 2014 20:22:38 +0000 (20:22 +0000)
committerMartin Read <mpread@chiark.greenend.org.uk>
Mon, 10 Mar 2014 20:22:38 +0000 (20:22 +0000)
display-nc.cc

index 2bd3722..1d9ad51 100644 (file)
@@ -1299,21 +1299,8 @@ void get_player_action(Action *act)
         case '<':
             {
                Terrain t = lvl.terrain_at(u.pos);
-               if (terrain_props[t].flags & TFLAG_portal)
+               if (terrain_props[t].flags & (TFLAG_portal | TFLAG_ascend))
                {
-                   if (terrain_props[t].flags & TFLAG_ascend)
-                   {
-                       act->cmd = GO_UP_STAIRS;
-                       return;
-                   }
-                   else
-                   {
-                       act->cmd = GO_DOWN_STAIRS;
-                       return;
-                   }
-               }
-               else if (terrain_props[t].flags & TFLAG_ascend)
-                {
                    act->cmd = GO_UP_STAIRS;
                    return;
                 }
@@ -1326,14 +1313,14 @@ void get_player_action(Action *act)
         case '>':
             {
                 Terrain t = lvl.terrain_at(u.pos);
-                if (terrain_props[t].flags & TFLAG_descend)
+                if (terrain_props[t].flags & (TFLAG_descend | TFLAG_portal))
                 {
                     act->cmd = GO_DOWN_STAIRS;
                     return;
                 }
                 else
                 {
-                    print_msg("There are no stairs or portals here.\n");
+                    print_msg("There are no portals or downward stairs here.\n");
                 }
             }
             break;