Fix for 22516 - mobs can no longer cause other mobs to be bonked against tables.
This commit is contained in:
@@ -3,6 +3,7 @@ using Content.Shared.Climbing.Components;
|
|||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
using Content.Shared.DoAfter;
|
using Content.Shared.DoAfter;
|
||||||
using Content.Shared.DragDrop;
|
using Content.Shared.DragDrop;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Interaction.Components;
|
using Content.Shared.Interaction.Components;
|
||||||
@@ -35,7 +36,7 @@ public sealed partial class BonkSystem : EntitySystem
|
|||||||
|
|
||||||
private void OnBonkDoAfter(EntityUid uid, Components.BonkableComponent component, BonkDoAfterEvent args)
|
private void OnBonkDoAfter(EntityUid uid, Components.BonkableComponent component, BonkDoAfterEvent args)
|
||||||
{
|
{
|
||||||
if (args.Handled || args.Cancelled || args.Args.Target == null)
|
if (args.Handled || args.Cancelled || args.Args.Target == null || args.Args.Target != args.Args.User)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TryBonk(args.Args.User, uid, component);
|
TryBonk(args.Args.User, uid, component);
|
||||||
@@ -76,7 +77,7 @@ public sealed partial class BonkSystem : EntitySystem
|
|||||||
|
|
||||||
private void OnDragDrop(EntityUid uid, Components.BonkableComponent component, ref DragDropTargetEvent args)
|
private void OnDragDrop(EntityUid uid, Components.BonkableComponent component, ref DragDropTargetEvent args)
|
||||||
{
|
{
|
||||||
if (args.Handled || !HasComp<ClumsyComponent>(args.Dragged))
|
if (args.Handled || !HasComp<ClumsyComponent>(args.Dragged) || !HasComp<HandsComponent>(args.User))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var doAfterArgs = new DoAfterArgs(EntityManager, args.Dragged, component.BonkDelay, new BonkDoAfterEvent(), uid, target: uid)
|
var doAfterArgs = new DoAfterArgs(EntityManager, args.Dragged, component.BonkDelay, new BonkDoAfterEvent(), uid, target: uid)
|
||||||
|
|||||||
@@ -163,11 +163,16 @@ public sealed partial class ClimbSystem : VirtualController
|
|||||||
if (args.Handled)
|
if (args.Handled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
var canVault = args.User == args.Dragged
|
var canVault = args.User == args.Dragged
|
||||||
? CanVault(component, args.User, uid, out _)
|
? CanVault(component, args.User, uid, out _)
|
||||||
: CanVault(component, args.User, args.Dragged, uid, out _);
|
: CanVault(component, args.User, args.Dragged, uid, out _);
|
||||||
|
|
||||||
args.CanDrop = canVault;
|
args.CanDrop = canVault;
|
||||||
|
|
||||||
|
if (!HasComp<HandsComponent>(args.User))
|
||||||
|
args.CanDrop = false;
|
||||||
|
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,9 +194,7 @@ public sealed partial class ClimbSystem : VirtualController
|
|||||||
|
|
||||||
private void OnClimbableDragDrop(EntityUid uid, ClimbableComponent component, ref DragDropTargetEvent args)
|
private void OnClimbableDragDrop(EntityUid uid, ClimbableComponent component, ref DragDropTargetEvent args)
|
||||||
{
|
{
|
||||||
// definitely a better way to check if two entities are equal
|
if (args.Handled)
|
||||||
// but don't have computer access and i have to do this without syntax
|
|
||||||
if (args.Handled || args.User != args.Dragged && !HasComp<HandsComponent>(args.User))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TryClimb(args.User, args.Dragged, uid, out _, component);
|
TryClimb(args.User, args.Dragged, uid, out _, component);
|
||||||
|
|||||||
Reference in New Issue
Block a user