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

@@ -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));