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:
parent
73a6b21141
commit
b855903f99
1 changed files with 2 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue