From bfec6699ce69ab8a4035abd2dcb97990c4a63676 Mon Sep 17 00:00:00 2001 From: Pao Date: Fri, 20 Jan 2023 23:13:09 +0100 Subject: [PATCH] Fixed stacking of traits --- media/lua/client/TOC_Update.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/media/lua/client/TOC_Update.lua b/media/lua/client/TOC_Update.lua index 8227008..d928f33 100644 --- a/media/lua/client/TOC_Update.lua +++ b/media/lua/client/TOC_Update.lua @@ -116,13 +116,16 @@ function TheOnlyCure.SetHealthStatusForBodyPart(part_data, part_name, player) part_data[part_name].is_cicatrized = true -- TODO make this random if the player gets it or not - --FIXME they're gonna stack!!!! - -- if player does not have brave then add it - -- if player does not have insensitve then add it + if (not player:HasTrait("Brave")) and ZombRand(1, 11) > 5 then + player:getTraits():add("Brave") + + end + + if (not player:HasTrait("Insensitive")) and ZombRand(1, 11) > 5 then + player:getTraits():add("Insensitive") + end - player:getTraits():add("Brave") - player:getTraits():add("Insensitive") body_part_type:setBleeding(false); body_part_type:setDeepWounded(false) body_part_type:setBleedingTime(0)