Skip to content

Commit

Permalink
m-and-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alwayswannahunt committed Dec 26, 2024
1 parent 5a3d6c9 commit e419f85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public sealed partial class IntimidatePersonConditionComponent : Component
public bool ObjectiveIsDone = false;

public IntimidatePersonDescriptionType DescriptionType;
// Two descriptions comes to help player differ done object from one which isn't.
// Descriptions comes to help player differ done object from one which isn't.

/// <summary>
/// Description will be applied at start. No params in it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,15 @@ private void OnDamageChanged(Entity<DamageReceivedTrackerComponent> entity, ref
&& entity.Comp.ResetTimeDamageOwnerTracked < _gameTiming.CurTime)
return;

if (entity.Comp.DamageTracker.AllowedState == null
|| !TryComp<MobStateComponent>(entity.Owner, out var mobState)
|| !entity.Comp.DamageTracker.AllowedState!.Contains(mobState.CurrentState))
if (entity.Comp.DamageTracker.AllowedState != null
&& (!TryComp<MobStateComponent>(entity.Owner, out var mobState)
|| entity.Comp.DamageTracker.AllowedState!.Contains(mobState.CurrentState)))
return;

var damageGroup = _prototype.Index(entity.Comp.DamageTracker.DamageGroup);
args.DamageDelta.TryGetDamageInGroup(damageGroup, out var trackableDamage);
entity.Comp.CurrentAmount += trackableDamage;

if (trackableDamage > 0)
entity.Comp.ResetTimeDamageOwnerTracked = _gameTiming.CurTime + TimeSpan.FromSeconds(ResetDamageOwnerDelaySeconds);
entity.Comp.ResetTimeDamageOwnerTracked = _gameTiming.CurTime + TimeSpan.FromSeconds(ResetDamageOwnerDelaySeconds);
}
}

0 comments on commit e419f85

Please sign in to comment.