fixes a bunch of warnings
This commit is contained in:
@@ -468,7 +468,7 @@ namespace Content.Shared.Body.Components
|
||||
var i = 0;
|
||||
foreach (var (part, slot) in SlotParts)
|
||||
{
|
||||
parts[i] = (slot.Id, Owner: part.Owner);
|
||||
parts[i] = (slot.Id, part.Owner);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,9 +111,6 @@ namespace Content.Shared.Hands.Components
|
||||
var hands = new List<HandVisualState>();
|
||||
foreach (var hand in Hands)
|
||||
{
|
||||
if (hand.HeldEntity == null)
|
||||
continue;
|
||||
|
||||
if (!entMan.TryGetComponent(hand.HeldEntity, out SharedItemComponent? item) || item.RsiPath == null)
|
||||
continue;
|
||||
|
||||
@@ -233,8 +230,8 @@ namespace Content.Shared.Hands.Components
|
||||
|
||||
public bool TryGetActiveHeldEntity(out EntityUid heldEntity)
|
||||
{
|
||||
heldEntity = GetActiveHand()?.HeldEntity ?? default;
|
||||
return heldEntity != null;
|
||||
heldEntity = GetActiveHand()?.HeldEntity ?? EntityUid.Invalid;
|
||||
return !heldEntity.Valid;
|
||||
}
|
||||
|
||||
public bool IsHolding(EntityUid entity)
|
||||
@@ -415,7 +412,7 @@ namespace Content.Shared.Hands.Components
|
||||
/// </summary>
|
||||
private bool CanRemoveHeldEntityFromHand(Hand hand)
|
||||
{
|
||||
if (hand.HeldEntity == null)
|
||||
if (!hand.HeldEntity.Valid)
|
||||
return false;
|
||||
|
||||
var heldEntity = hand.HeldEntity;
|
||||
@@ -446,7 +443,7 @@ namespace Content.Shared.Hands.Components
|
||||
/// </summary>
|
||||
private void RemoveHeldEntityFromHand(Hand hand)
|
||||
{
|
||||
if (hand.HeldEntity == null)
|
||||
if (!hand.HeldEntity.Valid)
|
||||
return;
|
||||
|
||||
var heldEntity = hand.HeldEntity;
|
||||
@@ -537,7 +534,7 @@ namespace Content.Shared.Hands.Components
|
||||
|
||||
private bool CanPutHeldEntityIntoContainer(Hand hand, IContainer targetContainer, bool checkActionBlocker)
|
||||
{
|
||||
if (hand.HeldEntity == null)
|
||||
if (!hand.HeldEntity.Valid)
|
||||
return false;
|
||||
|
||||
var heldEntity = hand.HeldEntity;
|
||||
@@ -556,7 +553,7 @@ namespace Content.Shared.Hands.Components
|
||||
/// </summary>
|
||||
private void PutHeldEntityIntoContainer(Hand hand, IContainer targetContainer)
|
||||
{
|
||||
if (hand.HeldEntity == null)
|
||||
if (!hand.HeldEntity.Valid)
|
||||
return;
|
||||
|
||||
var heldEntity = hand.HeldEntity;
|
||||
|
||||
@@ -650,7 +650,7 @@ namespace Content.Shared.Interaction
|
||||
/// <param name="used"></param>
|
||||
public void TryUseInteraction(EntityUid user, EntityUid used, bool altInteract = false)
|
||||
{
|
||||
if (user != null && used != null && _actionBlockerSystem.CanUse(user))
|
||||
if (user.Valid && used.Valid && _actionBlockerSystem.CanUse(user))
|
||||
{
|
||||
if (altInteract)
|
||||
AltInteract(user, used);
|
||||
@@ -820,7 +820,7 @@ namespace Content.Shared.Interaction
|
||||
/// </summary>
|
||||
public bool TryDroppedInteraction(EntityUid user, EntityUid item)
|
||||
{
|
||||
if (user == null || item == null || !_actionBlockerSystem.CanDrop(user)) return false;
|
||||
if (!user.Valid || !item.Valid || !_actionBlockerSystem.CanDrop(user)) return false;
|
||||
|
||||
DroppedInteraction(user, item);
|
||||
return true;
|
||||
|
||||
@@ -12,8 +12,6 @@ namespace Content.Shared.Standing
|
||||
{
|
||||
public sealed class StandingStateSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedHandsSystem _sharedHandsSystem = default!;
|
||||
|
||||
public bool IsDown(EntityUid uid, StandingStateComponent? standingState = null)
|
||||
{
|
||||
if (!Resolve(uid, ref standingState, false))
|
||||
|
||||
Reference in New Issue
Block a user