From 2326c3d4302f6b2810ff6a82078b5836af4650bf Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Tue, 5 Jul 2022 18:21:45 +0700 Subject: [PATCH] Remove useless health component code Siren's adjustemet code made cahgnes that were soon overwritten without accomplishing anything. And husk code has some player replication info obtaining code that is leftover from trying to restore perk resistances that... didn't actually break from damage type substitution. --- .../KF1Frontend/Health/KF1_HealthComponent.uc | 47 +++---------------- 1 file changed, 6 insertions(+), 41 deletions(-) diff --git a/sources/Gameplay/KF1Frontend/Health/KF1_HealthComponent.uc b/sources/Gameplay/KF1Frontend/Health/KF1_HealthComponent.uc index 0a0d4a9..643a5ff 100644 --- a/sources/Gameplay/KF1Frontend/Health/KF1_HealthComponent.uc +++ b/sources/Gameplay/KF1Frontend/Health/KF1_HealthComponent.uc @@ -104,51 +104,13 @@ private function int OnNetDamageHandler( Vector hitLocation, out Vector momentum, class damageType) -{ - if (damageType == class'Dummy_DamTypeVomit') { - damage = ReapplyNativeBileAdjustments(originalDamage, damage, injured); - } - if (damageType == class'Dummy_SirenScreamDamage') { - damage = ReapplyNativeScreamAdjustments(damage, injured, hitLocation); - } - return damage; -} - -private function int ReapplyNativeBileAdjustments( - int originalDamage, - int damage, - Pawn injured) { local KFPlayerReplicationInfo kfPRI; - if (ZombieBloatBase(injured) != none) { - return 0; - } - if (ZombieFleshpoundBase(injured) != none) { - return 0; - } - if (injured != none && injured.controller != none) - { - kfPRI = KFPlayerReplicationInfo( - injured.controller.playerReplicationInfo); - } - return damage; -} - -private function int ReapplyNativeScreamAdjustments( - int damage, - Pawn injured, - Vector hitLocation) -{ - local KFPawn injuredPawn; + if (damageType != class'Dummy_DamTypeVomit') return damage; + if (ZombieBloatBase(injured) != none) return 0; + if (ZombieFleshpoundBase(injured) != none) return 0; - injuredPawn = KFPawn(injured); - if (injuredPawn != none) - { - // TODO: `PlayHit()` is not informed about siren's damage!!! - // TODO: Neither are bloody projectiles! - injuredPawn.lastHitDamType = class'SirenScreamDamage'; - } return damage; } @@ -160,6 +122,9 @@ private function UpdateBileAchievement(Controller killer, Controller killed) local KFSteamStatsAndAchievements kfSteamStats; local array activeConnections; + // `GameInfo` checks that `killed != none`, but between that and this point + // a lot of things can change, so don't count on it and check + if (killed == none) return; killedMonster = KFMonster(killed.pawn); if (killedMonster == none) return; if (killedMonster.lastDamagedByType != class'Dummy_DamTypeVomit') return;