From 4a8d5b13a8fee2bc4816817168e38b8cf693802a Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Mon, 8 Aug 2022 11:01:52 +0300 Subject: [PATCH] Fix queue clearing --- src/queue.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/queue.cc b/src/queue.cc index 6c780bc..c2379eb 100644 --- a/src/queue.cc +++ b/src/queue.cc @@ -422,6 +422,11 @@ void _queue_clear_type(int eventType, QueueEventHandler* fn) } internal_free(tmp); + + // SFALL: Re-read next event since `fn` handler can change it. + // This fixes crash when leaving the map while waiting for + // someone to die of a super stimpak overdose. + curr = *ptr; } } else { ptr = &(curr->next);