Reworked caching

This commit is contained in:
ZioPao
2023-11-13 03:35:07 +01:00
parent deb6dcc056
commit e374601402
6 changed files with 117 additions and 80 deletions

View File

@@ -1,5 +1,5 @@
local CommonMethods = require("TOC/CommonMethods")
local PlayerHandler = require("TOC/Handlers/PlayerHandler")
local CachedDataHandler = require("TOC/Handlers/CachedDataHandler")
-------------------------
@@ -19,8 +19,9 @@ function ProsthesisHandler.CheckIfEquippable(bodyLocation)
TOC_DEBUG.print("current item is a prosthesis")
local side = CommonMethods.GetSide(bodyLocation)
for i=1, #PlayerHandler.amputatedLimbs do
local limbName = PlayerHandler.amputatedLimbs[i]
local amputatedLimbs = CachedDataHandler.GetAmputatedLimbs(getPlayer():getUsername())
for i=1, #amputatedLimbs do
local limbName = amputatedLimbs[i]
if string.contains(limbName, side) and not string.contains(limbName, "UpperArm") then
return true
end