From 3247720a46ca17370700e105705cf833d95d0f2b Mon Sep 17 00:00:00 2001 From: Shtoyan Date: Thu, 20 Jan 2022 22:10:13 +0400 Subject: [PATCH] RemovePoisonAndBleed inv accessed none fix --- sources/NiceReplicationInfo.uc | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/sources/NiceReplicationInfo.uc b/sources/NiceReplicationInfo.uc index cc1d99e..9a07d35 100644 --- a/sources/NiceReplicationInfo.uc +++ b/sources/NiceReplicationInfo.uc @@ -182,21 +182,32 @@ simulated function HandleNiceHealingMechanicsAndSkills healed.bZedTimeInvincible = true; } } -simulated function RemovePoisonAndBleed(NiceHumanPawn healed){ + +simulated function RemovePoisonAndBleed(NiceHumanPawn healed) +{ local Inventory I; local MeanReplicationInfo MRI; + + // log spam fix + if (healed == none) + return; + // No bleeding MRI = class'MeanReplicationInfo'.static. findSZri(healed.PlayerReplicationInfo); - if(MRI != none) + if (MRI != none) MRI.stopBleeding(); // No poison - if(healed.inventory == none) return; - for(I = healed.inventory; I != none; I = I.inventory){ - if(MeanPoisonInventory(I) != none) + if (healed.inventory == none) + return; + + for (I = healed.inventory; I != none; I = I.inventory) + { + if (MeanPoisonInventory(I) != none) I.Destroy(); } } + // Tells server to heal given human pawn. simulated function ServerHealTarget(NiceHumanPawn healed, float charPotency, Pawn instigator){