#define MAX_DIR 6
short int const dir[] = {DIR_NORTH, DIR_EAST, DIR_SOUTH, DIR_WEST, DIR_UP, DIR_DOWN};
char * const dir_name[] = {"north", "east", "south", "west", "up", "down"};
char * const short_dir_name[] = {"n", "e", "s", "w", "u", "d"};
short int const rev_dir[] = {DIR_SOUTH, DIR_WEST, DIR_NORTH, DIR_EAST, DIR_DOWN, DIR_UP};
short int find_door(CHAR_DATA *ch, char *arg) {
short int door = get_direction_number(arg);
door = door == MAX_DIR ? -1 : door;
if (ch && ch->in_room) {
EXIT_DATA *pexit = ch->in_room->exit[door];
if (!pexit)
return -1;
}
return door;
}
short int get_direction_number(char *arg) {
short int i;
for (i = 0;i < MAX_DIR;i ++)
if ( !str_cmp(short_dir_name[i], arg) || !str_cmp(dir_name[i], arg))
return i;
return MAX_DIR;
}
[b]
char * const dir_name [] =
{
"north", "east", "south", "west", "up", "down",
"northeast", "northwest", "southeast", "southwest", "somewhere"
};
[/b]
char * const dir_name [] =
{
"norte", "este", "sur", "oeste", "arriba", "abajo",
"noreste", "noroeste", sureste", "suroeste", "algunsitio"
};
char * const dir_name [] =
{
"norte", "este", "sur", "oeste", "arriba", "abajo",
"noreste", "noroeste", "sureste", "suroeste", "algunsitio"
};
sorry, but my english is very bad.
I've a problem. if I translate thee mud's exits in the file act_move.c, the areas's exits crash.
I do that:
in act_move.c I change:
And i change to:
And i change to:
[code[b]
EXIT_DATA *find_door( CHAR_DATA *ch, char *arg, bool quiet )
{
EXIT_DATA *pexit;
int door;
if (arg == NULL || !str_cmp(arg,""))
return NULL;
pexit = NULL;
if ( !str_cmp( arg, "n" ) || !str_cmp( arg, "north" ) ) door = 0;
else if ( !str_cmp( arg, "e" ) || !str_cmp( arg, "east" ) ) door = 1;
else if ( !str_cmp( arg, "s" ) || !str_cmp( arg, "south" ) ) door = 2;
else if ( !str_cmp( arg, "w" ) || !str_cmp( arg, "west" ) ) door = 3;
else if ( !str_cmp( arg, "u" ) || !str_cmp( arg, "up" ) ) door = 4;
else if ( !str_cmp( arg, "d" ) || !str_cmp( arg, "down" ) ) door = 5;
else if ( !str_cmp( arg, "ne" ) || !str_cmp( arg, "northeast" ) ) door = 6;
else if ( !str_cmp( arg, "nw" ) || !str_cmp( arg, "northwest" ) ) door = 7;
else if ( !str_cmp( arg, "se" ) || !str_cmp( arg, "southeast" ) ) door = 8;
else if ( !str_cmp( arg, "sw" ) || !str_cmp( arg, "southwest" ) ) door = 9;
…[/b]
EXIT_DATA *find_door( CHAR_DATA *ch, char *arg, bool quiet )
{
EXIT_DATA *pexit;
int door;
if (arg == NULL || !str_cmp(arg,""))
return NULL;
pexit = NULL;
if ( !str_cmp( arg, "n" ) || !str_cmp( arg, "norte" ) ) door = 0;
else if ( !str_cmp( arg, "e" ) || !str_cmp( arg, "este" ) ) door = 1;
else if ( !str_cmp( arg, "s" ) || !str_cmp( arg, "sur" ) ) door = 2;
else if ( !str_cmp( arg, "o" ) || !str_cmp( arg, "oeste" ) ) door = 3;
else if ( !str_cmp( arg, "ar" ) || !str_cmp( arg, "arriba" ) ) door = 4;
else if ( !str_cmp( arg, "ab" ) || !str_cmp( arg, "abajo" ) ) door = 5;
else if ( !str_cmp( arg, "ne" ) || !str_cmp( arg, "noreste" ) ) door = 6;
else if ( !str_cmp( arg, "no" ) || !str_cmp( arg, "noroeste" ) ) door = 7;
else if ( !str_cmp( arg, "se" ) || !str_cmp( arg, "sureste" ) ) door = 8;
else if ( !str_cmp( arg, "so" ) || !str_cmp( arg, "suroeste" ) ) door = 9;
…
[/code]
In the file build.c:
[code]
[b]
char *const trap_flags[] = {
"room", "obj", "enter", "leave", "open", "close", "get", "put", "pick",
"unlock", "north", "south", "east", "west", "up", "down", "examine",
"northeast", "northwest", "southeast", "southwest", "r6", "r7", "r8",
"r9", "r10", "r11", "r12", "r13", "r14", "r15"
};
[/b]
char *const trap_flags[] = {
"room", "obj", "enter", "leave", "open", "close", "get", "put", "pick",
"unlock", "norte", "sur", "este", "oeste", "arriba", "abajo", "examine",
"noreste", "noroeste", "sureste", "suroeste", "r6", "r7", "r8",
"r9", "r10", "r11", "r12", "r13", "r14", "r15"
};[/code]
If I try use the foldarea comand or I try save changes on some area, the exists are changed, and i see two exits at the north, for example. the 1th north exit connect with the room 1000, but the 2th north exit connect with the room 1002. Originally, the 2th north exit was the west or east exit, for example.
Can you help me, please?