From 457832952c1d297f86cc1896fe79b42e4062a534 Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Sun, 22 Sep 2024 18:34:17 -0400 Subject: [PATCH] Update ContestsSystem.cs --- Content.Shared/Contests/ContestsSystem.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Content.Shared/Contests/ContestsSystem.cs b/Content.Shared/Contests/ContestsSystem.cs index 4dc89e2bbc9..454d17a5d84 100644 --- a/Content.Shared/Contests/ContestsSystem.cs +++ b/Content.Shared/Contests/ContestsSystem.cs @@ -2,6 +2,7 @@ using Content.Shared.CCVar; using Content.Shared.Damage; using Content.Shared.Damage.Components; +using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Systems; using Content.Shared.Mood; using Robust.Shared.Configuration; @@ -226,7 +227,8 @@ public float HealthContest(EntityUid performer, bool bypassClamp = false, float if (!_cfg.GetCVar(CCVars.DoContestsSystem) || !_cfg.GetCVar(CCVars.DoHealthContests) || !TryComp(performer, out var damage) - || !_mobThreshold.TryGetThresholdForState(performer, Mobs.MobState.Critical, out var threshold)) + || !TryComp(performer, out var thresholdsComponent) + || !_mobThreshold.TryGetThresholdForState(performer, Mobs.MobState.Critical, out var threshold, thresholdsComponent)) return 1f; return ContestClamp(ContestClampOverride(bypassClamp) @@ -247,8 +249,10 @@ public float HealthContest(EntityUid performer, EntityUid target, bool bypassCla || !_cfg.GetCVar(CCVars.DoHealthContests) || !TryComp(performer, out var perfDamage) || !TryComp(target, out var targetDamage) - || !_mobThreshold.TryGetThresholdForState(performer, Mobs.MobState.Critical, out var perfThreshold) - || !_mobThreshold.TryGetThresholdForState(target, Mobs.MobState.Critical, out var targetThreshold)) + || !TryComp(performer, out var perfThresholdComp) + || !TryComp(target, out var targetThresholdComp) + || !_mobThreshold.TryGetThresholdForState(performer, Mobs.MobState.Critical, out var perfThreshold, perfThresholdComp) + || !_mobThreshold.TryGetThresholdForState(target, Mobs.MobState.Critical, out var targetThreshold, targetThresholdComp)) return 1f; return ContestClamp(ContestClampOverride(bypassClamp)