Moved dropping items over PlaceableSurfaces from AfterAttack to AttackBy (#209)
Added ClickLocation variable to AttackByEventArgs
This commit is contained in:
committed by
Pieter-Jan Briers
parent
8655dcaaf6
commit
b16768fd0b
@@ -12,7 +12,7 @@ using Robust.Shared.Maths;
|
||||
|
||||
namespace Content.Server.GameObjects
|
||||
{
|
||||
public class ItemComponent : StoreableComponent, IAttackHand, IAfterAttack
|
||||
public class ItemComponent : StoreableComponent, IAttackHand
|
||||
{
|
||||
public override string Name => "Item";
|
||||
public override uint? NetID => ContentNetIDs.ITEM;
|
||||
@@ -91,21 +91,6 @@ namespace Content.Server.GameObjects
|
||||
return new ItemComponentState(EquippedPrefix);
|
||||
}
|
||||
|
||||
public void AfterAttack(AfterAttackEventArgs eventArgs)
|
||||
{
|
||||
if (!eventArgs.User.TryGetComponent<HandsComponent>(out var handComponent))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (eventArgs.Attacked == null || !eventArgs.Attacked.TryGetComponent<PlaceableSurfaceComponent>(out var placeableSurfaceComponent))
|
||||
{
|
||||
return;
|
||||
}
|
||||
handComponent.Drop(handComponent.ActiveIndex);
|
||||
Owner.Transform.WorldPosition = eventArgs.ClickLocation.Position;
|
||||
return;
|
||||
}
|
||||
|
||||
public void Fumble()
|
||||
{
|
||||
if (Owner.TryGetComponent<PhysicsComponent>(out var physicsComponent))
|
||||
|
||||
Reference in New Issue
Block a user