No, lemme see if I can describe it. Its like a pyramid. At the top is the EXIT_DATA. One step below that is the structure for EXIT_DATA, direction, reverse direction, etc, and to_room. to_room is the chosen name for this instance of ROOM_INDEX_DATA. You can declare any name you want: location, to_room, room, dbfoothefoo, whatever you want. It is all of the same type. The name is not important, but the type is. So, back to the analogy. Most of the pyramid stops there: int and sh_int are not structures. However, there is another layer below to_room, leading to the room variables, where x,y, and z should SHOULD exist. The "to_room->x" says go down one layer from to_room to the x variable.
I may be wrong in my method, so try this:/*
* Check to see if a character can fall down, checks for looping -Thoric
*/
bool will_fall( CHAR_DATA *ch, int fall )
{
ROOM_INDEX_DATA *room;
if ( IS_SET( ch->in_room->room_flags, ROOM_NOFLOOR )
&& CAN_GO(ch, DIR_DOWN)
&& (!IS_AFFECTED( ch, AFF_FLYING )
|| ( ch->mount && !IS_AFFECTED( ch->mount, AFF_FLYING ) ) ) )
{
if ( fall > 80 )
{
bug( "Falling (in a loop?) more than 80 rooms: vnum %d", ch->in_room->vnum );
char_from_room( ch );
char_to_room( ch, get_room_index( ROOM_VNUM_TEMPLE ) );
fall = 0;
return TRUE;
}
set_char_color( AT_FALLING, ch );
send_to_char( "You're falling down...\n\r", ch );
move_char( ch, get_exit(ch->in_room, DIR_DOWN), ++fall );
room = get_exit(ch->in_room, DIR_DOWN)->to_room;
ch->coords[XCOORD] = number_range(0, room->x);
ch->coords[YCOORD] = number_range(0, room->y); /* random location in new room */
ch->coords[ZCOORD] = 0;
return TRUE;
}
return FALSE;
}
That should work, I tested it, and as long as you declared x,y, and z in the ROOM_INDEX_DATA structure in mud.h under those names, it should as well. |