From 0fa3e6a672f2cdd150867e8bcf09cb6757eb8b00 Mon Sep 17 00:00:00 2001 From: Atemo Date: Tue, 12 Jul 2022 22:32:16 +0200 Subject: [PATCH] Fixed a bug with the random options (#7100) Fixed an issue in the current random option system when the options are re-applied. --- src/map/itemdb.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/map/itemdb.cpp b/src/map/itemdb.cpp index 990fbeb033..7755f740b3 100644 --- a/src/map/itemdb.cpp +++ b/src/map/itemdb.cpp @@ -3245,6 +3245,13 @@ void s_random_opt_group::apply( struct item& item ){ item_option.param = option->param; }; + // (Re)initialize all the options + for( size_t i = 0; i < MAX_ITEM_RDM_OPT; i++ ){ + item.option[i].id = 0; + item.option[i].value = 0; + item.option[i].param = 0; + }; + // Apply Must options for( size_t i = 0; i < this->slots.size(); i++ ){ // Try to apply an entry