Fix a bunch of warnings (#9528)

This commit is contained in:
metalgearsloth
2022-07-09 09:07:47 +10:00
committed by GitHub
parent 9f80b7b68a
commit 4a393d4665
16 changed files with 65 additions and 82 deletions

View File

@@ -2,6 +2,7 @@ using System.Linq;
using Content.Shared.DragDrop;
using Content.Shared.Interaction;
using Content.Shared.MobState.Components;
using Content.Shared.MobState.EntitySystems;
using JetBrains.Annotations;
using Robust.Shared.Containers;
using Robust.Shared.Map;
@@ -15,6 +16,7 @@ namespace Content.Shared.Examine
{
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
[Dependency] protected readonly SharedMobStateSystem MobStateSystem = default!;
public const float MaxRaycastRange = 100;
@@ -43,8 +45,8 @@ namespace Content.Shared.Examine
public bool IsInDetailsRange(EntityUid examiner, EntityUid entity)
{
// check if the mob is in ciritcal or dead
if (EntityManager.TryGetComponent(examiner, out MobStateComponent? mobState) && mobState.IsIncapacitated())
// check if the mob is in critical or dead
if (MobStateSystem.IsIncapacitated(examiner))
return false;
if (!_interactionSystem.InRangeUnobstructed(examiner, entity, ExamineDetailsRange))
@@ -94,9 +96,9 @@ namespace Content.Shared.Examine
{
if (Resolve(examiner, ref mobState, logMissing: false))
{
if (mobState.IsDead())
if (MobStateSystem.IsDead(examiner, mobState))
return DeadExamineRange;
else if (mobState.IsCritical())
else if (MobStateSystem.IsCritical(examiner, mobState))
return CritExamineRange;
}
return ExamineRange;