From 761ea972b03f1c0e1a5746b6091f75c37f31c0ca 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..19fbc6b4f3f 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 ) {