Fix 3000 errors

This commit is contained in:
DrSmugleaf
2021-12-05 18:09:01 +01:00
parent 2bfec7ec62
commit 2a3b7d809d
569 changed files with 2979 additions and 3280 deletions

View File

@@ -250,7 +250,7 @@ namespace Content.Client.Hands
/// The item being held in this hand.
/// </summary>
[ViewVariables]
public IEntity? HeldItem { get; }
public EntityUid HeldItem { get; }
/// <summary>
/// The button in the gui associated with this hand. Assumed to be set by gui shortly after being received from the client HandsComponent.
@@ -258,7 +258,7 @@ namespace Content.Client.Hands
[ViewVariables]
public HandButton HandButton { get; set; } = default!;
public GuiHand(string name, HandLocation handLocation, IEntity? heldItem)
public GuiHand(string name, HandLocation handLocation, EntityUid heldItem)
{
Name = name;
HandLocation = handLocation;

View File

@@ -1,24 +1,22 @@
using System;
using Content.Shared.Hands.Components;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.ResourceManagement;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using System;
using System.Collections.Generic;
namespace Content.Client.Hands
{
[UsedImplicitly]
public class HandsVisualizer : AppearanceVisualizer
{
public override void OnChangeData(AppearanceComponent component)
{
base.OnChangeData(component);
if (!component.Owner.TryGetComponent<ISpriteComponent>(out var sprite)) return;
var entities = IoCManager.Resolve<IEntityManager>();
if (!entities.TryGetComponent<ISpriteComponent>(component.Owner, out var sprite)) return;
if (!component.TryGetData(HandsVisuals.VisualState, out HandsVisualState visualState)) return;
foreach (HandLocation location in Enum.GetValues(typeof(HandLocation)))

View File

@@ -46,7 +46,7 @@ namespace Content.Client.Hands
var sys = EntitySystem.Get<HandsSystem>();
var handEntity = sys.GetActiveHandEntity();
if (handEntity == null || !_cfg.GetCVar(CCVars.HudHeldItemShow) || !IoCManager.Resolve<IEntityManager>().HasComponent<ISpriteComponent>(handEntity))
if (handEntity == default || !_cfg.GetCVar(CCVars.HudHeldItemShow) || !IoCManager.Resolve<IEntityManager>().HasComponent<ISpriteComponent>(handEntity))
return;
var screen = args.ScreenHandle;

View File

@@ -56,13 +56,13 @@ namespace Content.Client.Hands
private void HandlePickupAnimation(PickupAnimationMessage msg)
{
if (!EntityManager.TryGetEntity(msg.EntityUid, out var entity))
if (!msg.EntityUid.IsValid())
return;
if (!_gameTiming.IsFirstTimePredicted)
return;
ReusableAnimations.AnimateEntityPickup(entity, msg.InitialPosition, msg.FinalPosition);
ReusableAnimations.AnimateEntityPickup(msg.EntityUid, msg.InitialPosition, msg.FinalPosition);
}
public HandsGuiState GetGuiState()
@@ -77,10 +77,10 @@ namespace Content.Client.Hands
return new HandsGuiState(states, hands.ActiveHand);
}
public IEntity? GetActiveHandEntity()
public EntityUid GetActiveHandEntity()
{
if (GetPlayerHandsComponent() is not { ActiveHand: { } active } hands)
return null;
return default;
return hands.GetHand(active).HeldEntity;
}
@@ -89,7 +89,7 @@ namespace Content.Client.Hands
{
var player = _playerManager.LocalPlayer?.ControlledEntity;
if (player == null || !IoCManager.Resolve<IEntityManager>().TryGetComponent(player, out HandsComponent? hands))
if (player is not {Valid: true} || !EntityManager.TryGetComponent(player.Value, out HandsComponent? hands))
return null;
return hands;
@@ -106,7 +106,7 @@ namespace Content.Client.Hands
var pressedEntity = pressedHand.HeldEntity;
var activeEntity = activeHand.HeldEntity;
if (pressedHand == activeHand && activeEntity != null)
if (pressedHand == activeHand && activeEntity != default)
{
// use item in hand
// it will always be attack_self() in my heart.
@@ -114,21 +114,21 @@ namespace Content.Client.Hands
return;
}
if (pressedHand != activeHand && pressedEntity == null)
if (pressedHand != activeHand && pressedEntity == default)
{
// change active hand
RaiseNetworkEvent(new RequestSetHandEvent(handName));
return;
}
if (pressedHand != activeHand && pressedEntity != null && activeEntity != null)
if (pressedHand != activeHand && pressedEntity != default && activeEntity != default)
{
// use active item on held item
RaiseNetworkEvent(new ClientInteractUsingInHandMsg(pressedHand.Name));
return;
}
if (pressedHand != activeHand && pressedEntity != null && activeEntity == null)
if (pressedHand != activeHand && pressedEntity != default && activeEntity == default)
{
// use active item on held item
RaiseNetworkEvent(new MoveItemFromHandMsg(pressedHand.Name));