From 7e087707cd4ac4d998117149135a348fccacb3ac Mon Sep 17 00:00:00 2001 From: Kindi Date: Sun, 15 Oct 2023 21:26:47 +0800 Subject: [PATCH] fix potential miscalculation --- apps/openmw/mwlua/itemdata.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/openmw/mwlua/itemdata.cpp b/apps/openmw/mwlua/itemdata.cpp index 0741b5ebe2..f2bd32703f 100644 --- a/apps/openmw/mwlua/itemdata.cpp +++ b/apps/openmw/mwlua/itemdata.cpp @@ -90,13 +90,9 @@ namespace MWLua ptr.getClass().setRemainingUsageTime(ptr, cond); else if (ptr.getClass().hasItemHealth(ptr)) { - const float lastChargeRemainder = ptr.getCellRef().getChargeIntRemainder(); // if the value set is less than 0, chargeInt and chargeIntRemainder is set to 0 ptr.getCellRef().setChargeIntRemainder(std::max(0.f, std::modf(cond, &cond))); ptr.getCellRef().setCharge(std::max(0.f, cond)); - // resolve the remaining charge remainder to be subtracted - if (lastChargeRemainder < 0) - ptr.getCellRef().applyChargeRemainderToBeSubtracted(lastChargeRemainder); } else invalidPropErr(prop, ptr);