From 1430959964f7518b018a390731a6a3469a701555 Mon Sep 17 00:00:00 2001 From: Pao Date: Wed, 18 Jan 2023 23:52:49 +0100 Subject: [PATCH] Really bad error --- media/lua/client/TOC_OverridenFunctions.lua | 23 ++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/media/lua/client/TOC_OverridenFunctions.lua b/media/lua/client/TOC_OverridenFunctions.lua index 5f13103..107f51c 100644 --- a/media/lua/client/TOC_OverridenFunctions.lua +++ b/media/lua/client/TOC_OverridenFunctions.lua @@ -8,16 +8,26 @@ local og_ISEquipTimedActionAdjustMaxTime = ISBaseTimedAction.adjustMaxTime -- TODO On death hide the amputation so that other players cant pick it up - --- FIXME something is seriously broken here, it stacks up function ISBaseTimedAction:adjustMaxTime(maxTime) - local original_max_time = og_ISEquipTimedActionAdjustMaxTime(self, maxTime) -- TODO will it work? + print("TOC: Input max time " .. tostring(maxTime)) + local original_max_time = og_ISEquipTimedActionAdjustMaxTime(self, maxTime) + + print("TOC: Return original max time: " .. tostring(original_max_time)) + + if original_max_time ~= -1 then + + local modified_max_time = original_max_time local part_data = getPlayer():getModData().TOC.Limbs local burn_factor = 1.3 + + + -- if it's -1, it should be instant. + + -- To make it faster, let's have everything already written in another func local all_body_parts = GetBodyParts() @@ -50,10 +60,13 @@ function ISBaseTimedAction:adjustMaxTime(maxTime) if modified_max_time > 10 * original_max_time then modified_max_time = 10 * original_max_time end - print("MODIFIED MAX TIME: " .. modified_max_time) - + print("TOC: Modified Max Time " .. modified_max_time) return modified_max_time + else + return original_max_time + end + end