Cleaning old stuff

This commit is contained in:
Pao
2023-01-21 00:14:33 +01:00
parent 0253b55940
commit 2937fe67df
2 changed files with 2 additions and 22 deletions

View File

@@ -134,7 +134,7 @@ function ISEquipWeaponAction:perform()
local part_data = self.character:getModData().TOC.Limbs local part_data = self.character:getModData().TOC.Limbs
local can_be_held = {} local can_be_held = {}
for _, side in ipairs ({"Left", "Right"}) do for _, side in ipairs (TOC_sides) do
can_be_held[side] = true can_be_held[side] = true
if part_data[side .. "_Hand"].is_cut then if part_data[side .. "_Hand"].is_cut then

View File

@@ -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 -- Helper for DropItem
function TheOnlyCure.CheckIfCanPickUpItem(toc_data, side, limb, secondary_limb) function TheOnlyCure.CheckIfCanPickUpItem(toc_data, side, limb, secondary_limb)
@@ -174,7 +155,6 @@ function TheOnlyCure.UpdateEveryOneMinute()
local toc_data = player:getModData().TOC local toc_data = player:getModData().TOC
if toc_data ~= nil then 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.CheckIfPlayerIsInfected(player, toc_data)
TheOnlyCure.UpdatePlayerHealth(player, toc_data.Limbs) TheOnlyCure.UpdatePlayerHealth(player, toc_data.Limbs)
end end
@@ -192,7 +172,7 @@ function TheOnlyCure.UpdateEveryTenMinutes()
local part_data = toc_data.Limbs local part_data = toc_data.Limbs
--Experience for prosthesis user --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 if part_data[side .. "_Hand"].is_prosthesis_equipped or part_data[side .. "_LowerArm"].is_prosthesis_equipped then
player:getXp():AddXP(Perks[side .. "_Hand"], 4) player:getXp():AddXP(Perks[side .. "_Hand"], 4)
end end