Question on grid maker

Posted by Gareth555 on Tue 24 Jun 2003 01:58 AM — 1 posts, 8,143 views.

#0
i have a coding question, in the grid maker i use
it only creates n e s w and u and d exits.
here is the code below. I would like to add
NE NW SE and SW to that. What would the xit = make_exit
line be in the new cases i want to add? (im not a coder):)

// Check to see if we can make N exits
if(room_count % x) {

location = get_room_index(vnum);
tmp = get_room_index(room_hold[room_count]);

xit = make_exit( location, tmp, 0 );
xit->keyword = STRALLOC( "" );
xit->description = STRALLOC( "" );
xit->key = -1;
xit->exit_info = 0;

}

// Check to see if we can make S exits
if((room_count - 1) % x) {

location = get_room_index(vnum);
tmp = get_room_index(room_hold[room_count - 2]);

xit = make_exit( location, tmp, 2 );
xit->keyword = STRALLOC( "" );
xit->description = STRALLOC( "" );
xit->key = -1;
xit->exit_info = 0;

}


// Check to see if we can make E exits
if( (room_count - 1) % (x * y) < x * y - x ) {

location = get_room_index(vnum);
tmp = get_room_index(room_hold[room_count + x - 1]);

xit = make_exit( location, tmp, 1 );
xit->keyword = STRALLOC( "" );
xit->description = STRALLOC( "" );
xit->key = -1;
xit->exit_info = 0;

}

// Check to see if we can make W exits
if( ( room_count - 1) % (x * y) >= x ) {

location = get_room_index(vnum);
tmp = get_room_index(room_hold[room_count - x - 1]);

xit = make_exit( location, tmp, 3 );
xit->keyword = STRALLOC( "" );
xit->description = STRALLOC( "" );
xit->key = -1;
xit->exit_info = 0;

}