From b855903f99d5af1c9a0efb436c69fa13467498d0 Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Thu, 8 Feb 2018 20:54:34 -0500 Subject: [PATCH] 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. --- urogue/things.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/urogue/things.c b/urogue/things.c index a3e781a..dad1af0 100644 --- a/urogue/things.c +++ b/urogue/things.c @@ -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;