From 2937fe67df8bdd879ee7937bed1af59893a6e750 Mon Sep 17 00:00:00 2001 From: Pao Date: Sat, 21 Jan 2023 00:14:33 +0100 Subject: [PATCH] Cleaning old stuff --- media/lua/client/TOC_OverridenFunctions.lua | 2 +- media/lua/client/TOC_Update.lua | 22 +-------------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/media/lua/client/TOC_OverridenFunctions.lua b/media/lua/client/TOC_OverridenFunctions.lua index cce63f5..5b217d2 100644 --- a/media/lua/client/TOC_OverridenFunctions.lua +++ b/media/lua/client/TOC_OverridenFunctions.lua @@ -134,7 +134,7 @@ function ISEquipWeaponAction:perform() local part_data = self.character:getModData().TOC.Limbs local can_be_held = {} - for _, side in ipairs ({"Left", "Right"}) do + for _, side in ipairs (TOC_sides) do can_be_held[side] = true if part_data[side .. "_Hand"].is_cut then diff --git a/media/lua/client/TOC_Update.lua b/media/lua/client/TOC_Update.lua index d928f33..8de1c75 100644 --- a/media/lua/client/TOC_Update.lua +++ b/media/lua/client/TOC_Update.lua @@ -1,22 +1,3 @@ --- Makes the player drop an item if they don't have a limb or haven't equipped a prosthesis -function TheOnlyCure.TryDropItem(player, toc_data) - - -- TODO this is old, was used in the update thing - if TheOnlyCure.CheckIfCanPickUpItem(toc_data, Right, Hand, Forearm) and player:getPrimaryHandItem() ~= nil then - if player:getPrimaryHandItem():getName() ~= "Bare Hands" then - player:dropHandItems() - end - end - - if TheOnlyCure.CheckIfCanPickUpItem(toc_data, Left, Hand, Forearm) and player:getSecondaryHandItem() ~= nil then - if player:getSecondaryHandItem():getName() ~= "Bare Hands" then - player:dropHandItems() - end - end - - -end - -- Helper for DropItem function TheOnlyCure.CheckIfCanPickUpItem(toc_data, side, limb, secondary_limb) @@ -174,7 +155,6 @@ function TheOnlyCure.UpdateEveryOneMinute() local toc_data = player:getModData().TOC if toc_data ~= nil then - --TheOnlyCure.TryDropItem(player, toc_data) -- TODO this must be set only in the cut\equipping function, not here TheOnlyCure.CheckIfPlayerIsInfected(player, toc_data) TheOnlyCure.UpdatePlayerHealth(player, toc_data.Limbs) end @@ -192,7 +172,7 @@ function TheOnlyCure.UpdateEveryTenMinutes() local part_data = toc_data.Limbs --Experience for prosthesis user - for _, side in ipairs({"Left", "Right"}) do + for _, side in ipairs(TOC_sides) do if part_data[side .. "_Hand"].is_prosthesis_equipped or part_data[side .. "_LowerArm"].is_prosthesis_equipped then player:getXp():AddXP(Perks[side .. "_Hand"], 4) end