I knew I was forgetting something like that! It's been a while since I did anything, so I forgot.
Anyways, managed to look through it and get the warnings and errors out of it. Also added the diagonal directions, and it all works well. Note: if you're going to spy northeast, you have to type out "northeast" not "ne". Check it out.
Code:
ACMD(do_spy)
{
int percent, prob, return_room;
char spy_type;
const char *spy_dirs[] = {
"north",
"east",
"south",
"west",
"up",
"down",
"northwest", /* Diagonals only used if CONFIG_DIAGONAL_DIRS is set */
"northeast",
"southeast",
"southwest",
"\n"
};
/* 101% is a complete failure */
percent = rand_number(1, 101);
prob = GET_SKILL(ch, SKILL_SPY);
spy_type = search_block(argument + 1, spy_dirs, FALSE);
if (spy_type < 0 || !EXIT(ch, spy_type) || EXIT(ch, spy_type)->to_room == NOWHERE) {
send_to_char(ch, "Spy where?\r\n");
return;
}
else {
if (!(GET_MOVE(ch) >= 5)) {
send_to_char(ch, "You don't have enough movement points.\r\n");
}
else {
if (percent > prob) {
send_to_char(ch, "You suck! You need more practice!!\r\n");
GET_MOVE(ch) = MAX(0, MIN(GET_MAX_MOVE(ch), GET_MOVE(ch) - 2));
}
else {
if (IS_SET(EXIT(ch, spy_type)->exit_info, EX_CLOSED) && EXIT(ch, spy_type)->keyword) {
send_to_char(ch, "The %s is closed.\r\n", fname(EXIT(ch, spy_type)->keyword));
GET_MOVE(ch) = MAX(0, MIN(GET_MAX_MOVE(ch), GET_MOVE(ch) - 2));
}
else {
GET_MOVE(ch) = MAX(0, MIN(GET_MAX_MOVE(ch), GET_MOVE(ch) - 5));
return_room = ch->in_room;
char_from_room(ch);
char_to_room(ch, world[return_room].dir_option[spy_type]->to_room);
send_to_char(ch, "You spy into the next room and see: \r\n\r\n");
look_at_room(ch, 1);
char_from_room(ch);
char_to_room(ch, return_room);
act("$n peeks into the next room.", TRUE, ch, 0, 0, TO_NOTVICT);
}
}
}
}
}