Let entities attack their outermost container (#13406)
Closes https://github.com/space-wizards/space-station-14/issues/13405 closes https://github.com/space-wizards/space-station-14/issues/13403
This commit is contained in:
@@ -56,6 +56,7 @@ public abstract class SharedMechSystem : EntitySystem
|
||||
|
||||
SubscribeLocalEvent<MechPilotComponent, GetMeleeWeaponEvent>(OnGetMeleeWeapon);
|
||||
SubscribeLocalEvent<MechPilotComponent, CanAttackFromContainerEvent>(OnCanAttackFromContainer);
|
||||
SubscribeLocalEvent<MechPilotComponent, AttackAttemptEvent>(OnAttackAttempt);
|
||||
}
|
||||
|
||||
#region State Handling
|
||||
@@ -451,6 +452,12 @@ public abstract class SharedMechSystem : EntitySystem
|
||||
args.CanAttack = true;
|
||||
}
|
||||
|
||||
private void OnAttackAttempt(EntityUid uid, MechPilotComponent component, AttackAttemptEvent args)
|
||||
{
|
||||
if (args.Target == component.Mech)
|
||||
args.Cancel();
|
||||
}
|
||||
|
||||
private void UpdateAppearance(EntityUid uid, SharedMechComponent ? component = null, AppearanceComponent? appearance = null)
|
||||
{
|
||||
if (!Resolve(uid, ref component, ref appearance, false))
|
||||
|
||||
Reference in New Issue
Block a user