Skip to content

Commit

Permalink
Fix Mood (Revert PR#564) (Vault-Overseers#566)
Browse files Browse the repository at this point in the history
Fix Mood
  • Loading branch information
VMSolidus authored Oct 5, 2024
1 parent cf68fc3 commit 0b92e0c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Content.Server/Mood/MoodSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ private void OnInit(EntityUid uid, MoodComponent component, ComponentStartup arg
if (_debugMode)
return;

if (TryComp<MobThresholdsComponent>(uid, out var mobThresholdsComponent)
if (_config.GetCVar(CCVars.MoodModifiesThresholds)
&& TryComp<MobThresholdsComponent>(uid, out var mobThresholdsComponent)
&& _mobThreshold.TryGetThresholdForState(uid, MobState.Critical, out var critThreshold, mobThresholdsComponent))
component.CritThresholdBeforeModify = critThreshold.Value;

Expand Down Expand Up @@ -343,7 +344,8 @@ private void RefreshShaders(EntityUid uid, int modifier)

private void SetCritThreshold(EntityUid uid, MoodComponent component, int modifier)
{
if (!TryComp<MobThresholdsComponent>(uid, out var mobThresholds)
if (!_config.GetCVar(CCVars.MoodModifiesThresholds)
|| !TryComp<MobThresholdsComponent>(uid, out var mobThresholds)
|| !_mobThreshold.TryGetThresholdForState(uid, MobState.Critical, out var key))
return;

Expand Down
5 changes: 4 additions & 1 deletion Content.Shared/CCVar/CCVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2446,14 +2446,17 @@ public static readonly CVarDef<float>
#region Mood System

public static readonly CVarDef<bool> MoodEnabled =
CVarDef.Create("mood.enabled", false, CVar.SERVER);
CVarDef.Create("mood.enabled", true, CVar.SERVER);

public static readonly CVarDef<bool> MoodIncreasesSpeed =
CVarDef.Create("mood.increases_speed", true, CVar.SERVER);

public static readonly CVarDef<bool> MoodDecreasesSpeed =
CVarDef.Create("mood.decreases_speed", true, CVar.SERVER);

public static readonly CVarDef<bool> MoodModifiesThresholds =
CVarDef.Create("mood.modify_thresholds", false, CVar.SERVER);

#endregion

#region Material Reclaimer
Expand Down

0 comments on commit 0b92e0c

Please sign in to comment.