somes tuff to fix before relase

This commit is contained in:
ZioPao
2024-05-02 01:24:18 +02:00
parent ff8032f26a
commit b1adefe8f3
9 changed files with 27 additions and 4 deletions

View File

@@ -44,3 +44,20 @@ local function AddAdminTocOptions(playerNum, context, worldobjects)
end
end
Events.OnFillWorldObjectContextMenu.Add(AddAdminTocOptions)
--* Override to cheats to fix stuff
local og_ISHealthPanel_onCheatCurrentPlayer = ISHealthPanel.onCheatCurrentPlayer
function ISHealthPanel.onCheatCurrentPlayer(bodyPart, action, player)
og_ISHealthPanel_onCheatCurrentPlayer(bodyPart, action, player)
if action == "healthFullBody" then
-- todo loop all limbs and reset them if infected
end
if action == "healthFull" then
-- todo get limbname from bodypart
end
end

View File

@@ -252,6 +252,13 @@ function DataController:getIsCauterized(limbName)
return self.tocData.limbs[limbName].isCauterized
end
---Get isInfected
---@param limbName string
---@return boolean
function DataController:getIsInfected(limbName)
return self.tocData.limbs[limbName].isInfected
end
---Get woundDirtyness
---@param limbName string
---@return number

View File

@@ -158,7 +158,7 @@ function LocalPlayerController.HandleDamage(character)
LocalPlayerController.HealZombieInfection(bd, bodyPart, limbName, dcInst)
end
else
if bodyPart:bitten() or bodyPart:IsInfected() then
if (bodyPart:bitten() or bodyPart:IsInfected()) and not dcInst:getIsInfected(limbName) then
dcInst:setIsInfected(limbName, true)
modDataNeedsUpdate = true
end