Fix 3000 errors
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user