object deletion during save operations
Not sure why my earlier attempt was unsuccessful. This one isn't as comprehensive but is simpler and better yet, works as intended. When saving a level or exiting the program, objects can be deleted directly rather than having to pass though the objs_deleted list.
This commit is contained in:
13
src/mkobj.c
13
src/mkobj.c
@@ -2739,10 +2739,15 @@ dealloc_obj(struct obj *obj)
|
||||
obj->where = OBJ_LUAFREE;
|
||||
return;
|
||||
}
|
||||
/* mark object as deleted, put it into queue to be freed */
|
||||
obj->where = OBJ_DELETED;
|
||||
obj->nobj = go.objs_deleted;
|
||||
go.objs_deleted = obj;
|
||||
if (!program_state.freeingdata) {
|
||||
/* mark object as deleted, put it into queue to be freed */
|
||||
obj->where = OBJ_DELETED;
|
||||
obj->nobj = go.objs_deleted;
|
||||
go.objs_deleted = obj;
|
||||
} else {
|
||||
/* when saving, there's no need to stage deletions on objs_deleted */
|
||||
dealloc_obj_real(obj);
|
||||
}
|
||||
}
|
||||
|
||||
/* actually deallocate the object */
|
||||
|
||||
Reference in New Issue
Block a user