hotfix to traits
This commit is contained in:
@@ -97,6 +97,14 @@ function DataController:setup(key)
|
|||||||
-- self.tocData.isInitializing = false
|
-- self.tocData.isInitializing = false
|
||||||
-- ModData.add(key, self.tocData)
|
-- ModData.add(key, self.tocData)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-- FIX THIS THING HERE ISN'T REALLY CORRECT BUT IT'S A WORKAROUND UNTIL WE FIGURE IT OUT
|
||||||
|
-- The issue is that we need to do this once, not every single time we load data.
|
||||||
|
-- Manage their traits
|
||||||
|
local LocalPlayerController = require("TOC/Controller/LocalPlayerController")
|
||||||
|
LocalPlayerController.ManageTraits(getPlayer())
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---In case of desync between the table on ModData and the table here
|
---In case of desync between the table on ModData and the table here
|
||||||
@@ -417,6 +425,8 @@ function DataController.ReceiveData(key, data)
|
|||||||
|
|
||||||
triggerEvent("OnReceivedTocData", handler.username)
|
triggerEvent("OnReceivedTocData", handler.username)
|
||||||
|
|
||||||
|
-- TODO We need an event to track if initialization has been finalized
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- if username == getPlayer():getUsername() and not handler.isResetForced then
|
-- if username == getPlayer():getUsername() and not handler.isResetForced then
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ require("TOC/Events")
|
|||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Handle ONLY stuff for the local client
|
-- Handle ONLY stuff for the local client
|
||||||
|
|
||||||
---@class LocalPlayerController
|
---@class LocalPlayerController
|
||||||
@@ -33,9 +35,6 @@ function LocalPlayerController.InitializePlayer(isForced)
|
|||||||
Events.OnAmputatedLimb.Add(LocalPlayerController.ToggleUpdateAmputations)
|
Events.OnAmputatedLimb.Add(LocalPlayerController.ToggleUpdateAmputations)
|
||||||
LocalPlayerController.ToggleUpdateAmputations()
|
LocalPlayerController.ToggleUpdateAmputations()
|
||||||
|
|
||||||
-- Manage their traits
|
|
||||||
LocalPlayerController.ManageTraits(playerObj)
|
|
||||||
|
|
||||||
-- Since isForced is used to reset an existing player data, we're gonna clean their ISHealthPanel table too
|
-- Since isForced is used to reset an existing player data, we're gonna clean their ISHealthPanel table too
|
||||||
if isForced then
|
if isForced then
|
||||||
local ItemsController = require("TOC/Controllers/ItemsController")
|
local ItemsController = require("TOC/Controllers/ItemsController")
|
||||||
@@ -50,6 +49,9 @@ end
|
|||||||
---Handles the traits
|
---Handles the traits
|
||||||
---@param playerObj IsoPlayer
|
---@param playerObj IsoPlayer
|
||||||
function LocalPlayerController.ManageTraits(playerObj)
|
function LocalPlayerController.ManageTraits(playerObj)
|
||||||
|
|
||||||
|
-- FIX This can fail if we haven't initialized TOC in time`
|
||||||
|
|
||||||
local AmputationHandler = require("TOC/Handlers/AmputationHandler")
|
local AmputationHandler = require("TOC/Handlers/AmputationHandler")
|
||||||
for k, v in pairs(StaticData.TRAITS_BP) do
|
for k, v in pairs(StaticData.TRAITS_BP) do
|
||||||
if playerObj:HasTrait(k) then
|
if playerObj:HasTrait(k) then
|
||||||
|
|||||||
Reference in New Issue
Block a user