From 0e7e7c546899c9b0899409b39860767e6bdaab86 Mon Sep 17 00:00:00 2001 From: Sarah Wesker Date: Thu, 14 Mar 2024 14:11:15 -0400 Subject: [PATCH] refactor decayTimeMax if/else --- src/item.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/item.cpp b/src/item.cpp index 8a6cf49..d2b0baa 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -238,12 +238,7 @@ void Item::setID(uint16_t newid) id = newid; const ItemType& it = Item::items[newid]; - uint32_t newDuration; - if (it.decayTimeMin != 0 && it.decayTimeMax != 0) { - newDuration = normal_random(it.decayTimeMin, it.decayTimeMax) * 1000; - } else { - newDuration = it.decayTimeMin * 1000; - } + uint32_t newDuration = normal_random(it.decayTimeMin, it.decayTimeMax) * 1000; if (newDuration == 0 && !it.stopTime && it.decayTo < 0) { removeAttribute(ITEM_ATTRIBUTE_DECAYSTATE);