mirror of
https://github.com/tbamud/tbamud.git
synced 2025-12-20 17:20:12 +01:00
Fixed object loading issue for houses.
This commit is contained in:
parent
e37c9708dd
commit
60a2f0ff7b
1 changed files with 29 additions and 16 deletions
|
|
@ -1005,7 +1005,8 @@ obj_save_data *objsave_parse_objects(FILE *fl)
|
|||
while (tempsave) {
|
||||
if (tempsave->next == current)
|
||||
tempsave->next = NULL;
|
||||
tempsave = tempsave->next; }
|
||||
tempsave = tempsave->next;
|
||||
}
|
||||
free(current);
|
||||
}
|
||||
}
|
||||
|
|
@ -1025,10 +1026,15 @@ obj_save_data *objsave_parse_objects(FILE *fl)
|
|||
if (*line == '#') {
|
||||
/* check for false alarm. */
|
||||
if (sscanf(line, "#%d", &nr) == 1) {
|
||||
if (real_object(nr) == NOTHING) { //object does not exist
|
||||
/* I'm currently unaware as to why the following IF skips on the
|
||||
* loop when an object is returned NOTHING due to the fact that "NOTHING"
|
||||
* is handled in below in such an instance. Unless someone knows why
|
||||
* this was written as such, it's now obsolete.
|
||||
* -Vatiken
|
||||
if (real_object(nr) == NOTHING) {
|
||||
log("SYSERR: Protection: deleting object %d.", nr);
|
||||
continue;
|
||||
}
|
||||
} */
|
||||
if (temp) {
|
||||
current->obj = temp;
|
||||
CREATE(current->next, obj_save_data, 1);
|
||||
|
|
@ -1037,9 +1043,9 @@ obj_save_data *objsave_parse_objects(FILE *fl)
|
|||
current->locate = 0;
|
||||
temp = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
continue;
|
||||
|
||||
/* we have the number, check it, load obj. */
|
||||
if (nr == NOTHING) { /* then it is unique */
|
||||
temp = create_obj();
|
||||
|
|
@ -1058,6 +1064,13 @@ obj_save_data *objsave_parse_objects(FILE *fl)
|
|||
continue;
|
||||
}
|
||||
|
||||
/* Should never get here, but since we did in the past, I'll put
|
||||
* a safety check in. */
|
||||
if (temp == NULL) {
|
||||
log("SYSERR: Attempting to parse obj_save_data on NULL object.");
|
||||
abort();
|
||||
}
|
||||
|
||||
tag_argument(line, tag);
|
||||
num = atoi(line);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue