Skip to content

Commit

Permalink
Update ContestsSystem.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
VMSolidus committed Sep 22, 2024
1 parent 900630c commit 4578329
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Content.Shared/Contests/ContestsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -226,7 +227,8 @@ public float HealthContest(EntityUid performer, bool bypassClamp = false, float
if (!_cfg.GetCVar(CCVars.DoContestsSystem)
|| !_cfg.GetCVar(CCVars.DoHealthContests)
|| !TryComp<DamageableComponent>(performer, out var damage)
|| !_mobThreshold.TryGetThresholdForState(performer, Mobs.MobState.Critical, out var threshold))
|| !TryComp<MobThresholdsComponent>(performer, out var thresholdsComponent)
|| !_mobThreshold.TryGetThresholdForState(performer, Mobs.MobState.Critical, out var threshold, thresholdsComponent))
return 1f;

return ContestClamp(ContestClampOverride(bypassClamp)
Expand All @@ -247,8 +249,10 @@ public float HealthContest(EntityUid performer, EntityUid target, bool bypassCla
|| !_cfg.GetCVar(CCVars.DoHealthContests)
|| !TryComp<DamageableComponent>(performer, out var perfDamage)
|| !TryComp<DamageableComponent>(target, out var targetDamage)
|| !_mobThreshold.TryGetThresholdForState(performer, Mobs.MobState.Critical, out var perfThreshold)
|| !_mobThreshold.TryGetThresholdForState(target, Mobs.MobState.Critical, out var targetThreshold))
|| !TryComp<MobThresholdsComponent>(performer, out var perfThresholdComp)
|| !TryComp<MobThresholdsComponent>(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)
Expand Down

0 comments on commit 4578329

Please sign in to comment.