}
}
- /* Now we know what's happening. Let's tell the poor sucker about it.
- * Note that various of the "knife" messages must have specific relative
- * positions in the rspeak database. */
+ /* Now we know what's happening. Let's tell the poor sucker about it. */
if (game.dtotal == 0)
return true;
rspeak(game.dtotal == 1 ? DWARF_SINGLE : DWARF_PACK, game.dtotal);
if (travel[travel_entry].stop) {
/* Couldn't find an entry matching the motion word passed
* in. Various messages depending on word given. */
- int spk = CANT_APPLY;
- if (motion >= EAST && motion <= NW)
- spk = BAD_DIRECTION;
- if (motion == UP ||
- motion == DOWN)
- spk = BAD_DIRECTION;
- if (motion == FORWARD ||
- motion == LEFT ||
- motion == RIGHT)
- spk = UNSURE_FACING;
- if (motion == OUTSIDE ||
- motion == INSIDE)
- spk = NO_INOUT_HERE;
- if (motion == XYZZY ||
- motion == PLUGH)
- spk = NOTHING_HAPPENS;
- if (motion == CRAWL)
- spk = WHICH_WAY;
- rspeak(spk);
+ switch (motion) {
+ case EAST:
+ case WEST:
+ case SOUTH:
+ case NORTH:
+ case NE:
+ case NW:
+ case SW:
+ case SE:
+ case UP:
+ case DOWN:
+ rspeak(BAD_DIRECTION);
+ break;
+ case FORWARD:
+ case LEFT:
+ case RIGHT:
+ rspeak(UNSURE_FACING);
+ break;
+ case OUTSIDE:
+ case INSIDE:
+ rspeak(NO_INOUT_HERE);
+ break;
+ case XYZZY:
+ case PLUGH:
+ rspeak(NOTHING_HAPPENS);
+ break;
+ case CRAWL:
+ rspeak(WHICH_WAY);
+ break;
+ default:
+ rspeak(CANT_APPLY);
+ }
return;
}
++travel_entry;
case GO_WORD2:
/* Get second word for analysis. */
command.wd1 = command.wd2;
- strcpy(command.raw1, command.raw2);
+ strncpy(command.raw1, command.raw2, LINESIZE - 1);
wordclear(&command.wd2);
command.raw2[0] = '\0';
goto L2620;