Spill hand contents when dropping them in a fall (#3304)

* Spill hand contents when dropping them due to falling down

* Better approach

* cleanup

* grammar

* stupid
This commit is contained in:
Clyybber
2021-02-18 21:43:46 +01:00
committed by GitHub
parent 3766410178
commit c996021b5d
6 changed files with 50 additions and 33 deletions

View File

@@ -716,11 +716,11 @@ namespace Content.Server.GameObjects.EntitySystems.Click
/// Activates the Dropped behavior of an object
/// Verifies that the user is capable of doing the drop interaction first
/// </summary>
public bool TryDroppedInteraction(IEntity user, IEntity item)
public bool TryDroppedInteraction(IEntity user, IEntity item, bool intentional)
{
if (user == null || item == null || !ActionBlockerSystem.CanDrop(user)) return false;
DroppedInteraction(user, item);
DroppedInteraction(user, item, intentional);
return true;
}
@@ -728,9 +728,9 @@ namespace Content.Server.GameObjects.EntitySystems.Click
/// Calls Dropped on all components that implement the IDropped interface
/// on an entity that has been dropped.
/// </summary>
public void DroppedInteraction(IEntity user, IEntity item)
public void DroppedInteraction(IEntity user, IEntity item, bool intentional)
{
var dropMsg = new DroppedMessage(user, item);
var dropMsg = new DroppedMessage(user, item, intentional);
RaiseLocalEvent(dropMsg);
if (dropMsg.Handled)
{
@@ -742,7 +742,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click
// Call Land on all components that implement the interface
foreach (var comp in comps)
{
comp.Dropped(new DroppedEventArgs(user));
comp.Dropped(new DroppedEventArgs(user, intentional));
}
}