Fixed Crash occuring from invalid objects in player object files

This commit is contained in:
Fizban 2010-03-18 02:33:03 +00:00
parent 80083e16c0
commit 972f6ce2af
2 changed files with 6 additions and 0 deletions

View file

@ -36,6 +36,8 @@ Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
(lots of major bugfixes too)
@
tbaMUD 3.61
[Mar 17 2010] - Fizban
Made non-existant objects in pfiles be skipped instead of crashing the MUD (thanks drefs)
[Feb 13 2010] - Rumble
Removed delete object option in oedit menu.
[Feb 08 2010] - Rumble

View file

@ -1025,6 +1025,10 @@ 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
log("SYSERR: Protection: deleting object %d.", nr);
continue;
}
if (temp) {
current->obj = temp;
CREATE(current->next, obj_save_data, 1);