From 40da330b4146de5be0edd8638536eb4de4109572 Mon Sep 17 00:00:00 2001 From: ZioPao Date: Tue, 16 Dec 2025 00:51:05 +0100 Subject: [PATCH] fix: trait init in LocalPlayerController --- .../lua/client/TOC/Controllers/LocalPlayerController.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/42/media/lua/client/TOC/Controllers/LocalPlayerController.lua b/42/media/lua/client/TOC/Controllers/LocalPlayerController.lua index b464a5a..37c7cf3 100644 --- a/42/media/lua/client/TOC/Controllers/LocalPlayerController.lua +++ b/42/media/lua/client/TOC/Controllers/LocalPlayerController.lua @@ -2,6 +2,7 @@ local DataController = require("TOC/Controllers/DataController") local CommonMethods = require("TOC/CommonMethods") local CachedDataHandler = require("TOC/Handlers/CachedDataHandler") local StaticData = require("TOC/StaticData") +local TOC_Registries = require("TOC/Registries") require("TOC/Events") ----------- @@ -55,11 +56,13 @@ function LocalPlayerController.ManageTraits() local playerObj = getPlayer() local AmputationHandler = require("TOC/Handlers/AmputationHandler") - for k, v in pairs(StaticData.TRAITS_BP) do - if playerObj:hasTrait(k) then + + for k, v in pairs(TOC_Registries.Traits) do + if playerObj:hasTrait(v) then -- Once we find one, we should be done since they're exclusive TOC_DEBUG.print("Player has amputation trait " .. k .. ", executing it") - local tempHandler = AmputationHandler:new(v, playerObj) + local limbName = StaticData.TRAITS_BP[k] + local tempHandler = AmputationHandler:new(limbName, playerObj) tempHandler:execute(false) -- No damage tempHandler:close()