Revert "fixes a bunch of warnings"

This reverts commit d4d85b663f.
This commit is contained in:
Paul
2021-12-20 15:20:27 +01:00
parent 7757b94333
commit 97e47178d7
68 changed files with 168 additions and 113 deletions

View File

@@ -468,7 +468,7 @@ namespace Content.Shared.Body.Components
var i = 0;
foreach (var (part, slot) in SlotParts)
{
parts[i] = (slot.Id, part.Owner);
parts[i] = (slot.Id, Owner: part.Owner);
i++;
}

View File

@@ -111,6 +111,9 @@ 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;
@@ -230,8 +233,8 @@ namespace Content.Shared.Hands.Components
public bool TryGetActiveHeldEntity(out EntityUid heldEntity)
{
heldEntity = GetActiveHand()?.HeldEntity ?? EntityUid.Invalid;
return !heldEntity.Valid;
heldEntity = GetActiveHand()?.HeldEntity ?? default;
return heldEntity != null;
}
public bool IsHolding(EntityUid entity)
@@ -412,7 +415,7 @@ namespace Content.Shared.Hands.Components
/// </summary>
private bool CanRemoveHeldEntityFromHand(Hand hand)
{
if (!hand.HeldEntity.Valid)
if (hand.HeldEntity == null)
return false;
var heldEntity = hand.HeldEntity;
@@ -443,7 +446,7 @@ namespace Content.Shared.Hands.Components
/// </summary>
private void RemoveHeldEntityFromHand(Hand hand)
{
if (!hand.HeldEntity.Valid)
if (hand.HeldEntity == null)
return;
var heldEntity = hand.HeldEntity;
@@ -534,7 +537,7 @@ namespace Content.Shared.Hands.Components
private bool CanPutHeldEntityIntoContainer(Hand hand, IContainer targetContainer, bool checkActionBlocker)
{
if (!hand.HeldEntity.Valid)
if (hand.HeldEntity == null)
return false;
var heldEntity = hand.HeldEntity;
@@ -553,7 +556,7 @@ namespace Content.Shared.Hands.Components
/// </summary>
private void PutHeldEntityIntoContainer(Hand hand, IContainer targetContainer)
{
if (!hand.HeldEntity.Valid)
if (hand.HeldEntity == null)
return;
var heldEntity = hand.HeldEntity;

View File

@@ -650,7 +650,7 @@ namespace Content.Shared.Interaction
/// <param name="used"></param>
public void TryUseInteraction(EntityUid user, EntityUid used, bool altInteract = false)
{
if (user.Valid && used.Valid && _actionBlockerSystem.CanUse(user))
if (user != null && used != null && _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.Valid || !item.Valid || !_actionBlockerSystem.CanDrop(user)) return false;
if (user == null || item == null || !_actionBlockerSystem.CanDrop(user)) return false;
DroppedInteraction(user, item);
return true;

View File

@@ -12,6 +12,8 @@ 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))