From 89258f243026a65da55065b9bcf6976ce2042b76 Mon Sep 17 00:00:00 2001 From: jsn Date: Thu, 2 Jan 2025 21:46:19 +0800 Subject: [PATCH] Clear item list for every storage at unit freeing --- src/map/unit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/map/unit.c b/src/map/unit.c index c5c9f1e82d5..b5c718373a3 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -3004,6 +3004,9 @@ static int unit_free(struct block_list *bl, enum clr_type clrtype) VECTOR_CLEAR(sd->hatEffectId); VECTOR_CLEAR(sd->title_ids); // Title [Dastgir/Hercules] VECTOR_CLEAR(sd->agency_requests); + + for (int i = 0; i < VECTOR_LENGTH(sd->storage.list); i++) { + VECTOR_CLEAR(VECTOR_INDEX(sd->storage.list, i).item); VECTOR_CLEAR(sd->storage.list); if( sd->quest_log != NULL ) {