mirror of
https://github.com/tbamud/tbamud.git
synced 2026-02-20 02:21:44 +01:00
Added diagonal directions, hidden exits flag and bug fixes
This commit is contained in:
13
src/genwld.c
13
src/genwld.c
@@ -107,7 +107,7 @@ room_rnum add_room(struct room_data *room)
|
||||
i = top_of_world + 1;
|
||||
do {
|
||||
i--;
|
||||
for (j = 0; j < NUM_OF_DIRS; j++)
|
||||
for (j = 0; j < DIR_COUNT; j++)
|
||||
if (W_EXIT(i, j) && W_EXIT(i, j)->to_room != NOWHERE)
|
||||
W_EXIT(i, j)->to_room += (W_EXIT(i, j)->to_room >= found);
|
||||
} while (i > 0);
|
||||
@@ -172,7 +172,7 @@ int delete_room(room_rnum rnum)
|
||||
i = top_of_world + 1;
|
||||
do {
|
||||
i--;
|
||||
for (j = 0; j < NUM_OF_DIRS; j++) {
|
||||
for (j = 0; j < NUM_OF_DIRS; j++) { /* NUM_OF_DIRS, not DIR_COUNT */
|
||||
if (W_EXIT(i, j) == NULL)
|
||||
continue;
|
||||
else if (W_EXIT(i, j)->to_room > rnum)
|
||||
@@ -301,7 +301,7 @@ int save_rooms(zone_rnum rzone)
|
||||
);
|
||||
|
||||
/* Now you write out the exits for the room. */
|
||||
for (j = 0; j < NUM_OF_DIRS; j++) {
|
||||
for (j = 0; j < DIR_COUNT; j++) {
|
||||
if (R_EXIT(room, j)) {
|
||||
int dflag;
|
||||
if (R_EXIT(room, j)->general_description) {
|
||||
@@ -316,6 +316,9 @@ int save_rooms(zone_rnum rzone)
|
||||
dflag = 2;
|
||||
else
|
||||
dflag = 1;
|
||||
|
||||
if (IS_SET(R_EXIT(room, j)->exit_info, EX_HIDDEN))
|
||||
dflag += 2;
|
||||
} else
|
||||
dflag = 0;
|
||||
|
||||
@@ -395,7 +398,7 @@ int copy_room_strings(struct room_data *dest, struct room_data *source)
|
||||
dest->description = str_udup(source->description);
|
||||
dest->name = str_udup(source->name);
|
||||
|
||||
for (i = 0; i < NUM_OF_DIRS; i++) {
|
||||
for (i = 0; i < DIR_COUNT; i++) {
|
||||
if (!R_EXIT(source, i))
|
||||
continue;
|
||||
|
||||
@@ -426,7 +429,7 @@ int free_room_strings(struct room_data *room)
|
||||
free_ex_descriptions(room->ex_description);
|
||||
|
||||
/* Free exits. */
|
||||
for (i = 0; i < NUM_OF_DIRS; i++) {
|
||||
for (i = 0; i < NUM_OF_DIRS; i++) { /* NUM_OF_DIRS, not DIR_COUNT */
|
||||
if (room->dir_option[i]) {
|
||||
if (room->dir_option[i]->general_description)
|
||||
free(room->dir_option[i]->general_description);
|
||||
|
||||
Reference in New Issue
Block a user