diff --git a/media/lua/client/Handlers/TOC_PlayerHandler.lua b/media/lua/client/Handlers/TOC_PlayerHandler.lua index 654f15a..0c77f51 100644 --- a/media/lua/client/Handlers/TOC_PlayerHandler.lua +++ b/media/lua/client/Handlers/TOC_PlayerHandler.lua @@ -50,9 +50,8 @@ function PlayerHandler.CheckInfection(character) -- This fucking event barely works. Bleeding seems to be the only thing that triggers it if character ~= getPlayer() then return end - local bd = character:getBodyDamage() - + if bd == nil then return end -- Not sure why sometimes we get no BodyDamage, so just return this for now for i=1, #StaticData.LIMBS_STRINGS do local limbName = StaticData.LIMBS_STRINGS[i] local bptEnum = StaticData.BODYPARTSTYPES_ENUM[limbName] diff --git a/media/lua/client/TOC_StaticData.lua b/media/lua/client/TOC_StaticData.lua index aaae948..00d2850 100644 --- a/media/lua/client/TOC_StaticData.lua +++ b/media/lua/client/TOC_StaticData.lua @@ -60,13 +60,17 @@ end --- Textures -- TODO We need male variations StaticData.HEALTH_PANEL_TEXTURES = { - Hand_L = getTexture("media/ui/Hand_L.png"), - ForeArm_L = getTexture("media/ui/ForeArm_L.png"), - UpperArm_L = getTexture("media/ui/UpperArm_L.png"), - Hand_R = getTexture("media/ui/Hand_R.png"), - ForeArm_R = getTexture("media/ui/ForeArm_R.png"), - UpperArm_R = getTexture("media/ui/UpperArm_R.png") + Female = { + Hand_L = getTexture("media/ui/Hand_L.png"), + ForeArm_L = getTexture("media/ui/ForeArm_L.png"), + UpperArm_L = getTexture("media/ui/UpperArm_L.png"), + + Hand_R = getTexture("media/ui/Hand_R.png"), + ForeArm_R = getTexture("media/ui/ForeArm_R.png"), + UpperArm_R = getTexture("media/ui/UpperArm_R.png") + } + } diff --git a/media/lua/client/UI/TOC_HealthPanel.lua b/media/lua/client/UI/TOC_HealthPanel.lua index 0d40b83..8da97e8 100644 --- a/media/lua/client/UI/TOC_HealthPanel.lua +++ b/media/lua/client/UI/TOC_HealthPanel.lua @@ -51,6 +51,16 @@ function ISHealthPanel.GetHighestAmputation() end +local og_ISHealthPanel_initialise = ISHealthPanel.initialise +function ISHealthPanel:initialise() + if self.character:isFemale() then + self.sexPl = "Female" + else + self.sexPl = "Male" + end + og_ISHealthPanel_initialise(self) +end + local og_ISHealthPanel_render = ISHealthPanel.render function ISHealthPanel:render() og_ISHealthPanel_render(self) @@ -60,13 +70,13 @@ function ISHealthPanel:render() if ISHealthPanel.highestAmputations then -- Left Texture if ISHealthPanel.highestAmputations["L"] then - local textureL = StaticData.HEALTH_PANEL_TEXTURES[ISHealthPanel.highestAmputations["L"]] + local textureL = StaticData.HEALTH_PANEL_TEXTURES[self.sexPl][ISHealthPanel.highestAmputations["L"]] self:drawTexture(textureL, self.healthPanel.x/2 - 2, self.healthPanel.y/2, 1, 1, 0, 0) end -- Right Texture if ISHealthPanel.highestAmputations["R"] then - local textureR = StaticData.HEALTH_PANEL_TEXTURES[ISHealthPanel.highestAmputations["R"]] + local textureR = StaticData.HEALTH_PANEL_TEXTURES[self.sexPl][ISHealthPanel.highestAmputations["R"]] self:drawTexture(textureR, self.healthPanel.x/2 + 2, self.healthPanel.y/2, 1, 1, 0, 0) end else