UltraRogue: clear the next_obj field when removing items from the floor.

The next_obj field is a pointer which the top item in a stack uses to
keep a list of the other items.  When removing an item from the stack,
rem_obj() failed to set next_obj to NULL, which can cause items in
monster inventory to point to items earlier in the inventory list.
That causes infinite co-recursion when saving or restoring.
This commit is contained in:
John "Elwin" Edwards 2018-02-08 20:54:34 -05:00
parent 73a6b21141
commit b855903f99

View file

@ -292,6 +292,8 @@ rem_obj(struct linked_list *item, int dis)
if (op->next_obj)
objptr->next_obj->l_prev = NULL;
objptr->next_obj = NULL;
y = op->o_pos.y;
x = op->o_pos.x;