pneumatic cannon fixes (#14705)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -169,7 +169,8 @@ public sealed partial class GunSystem : SharedGunSystem
|
||||
});
|
||||
}
|
||||
|
||||
public override void Shoot(EntityUid gunUid, GunComponent gun, List<(EntityUid? Entity, IShootable Shootable)> ammo, EntityCoordinates fromCoordinates, EntityCoordinates toCoordinates, EntityUid? user = null)
|
||||
public override void Shoot(EntityUid gunUid, GunComponent gun, List<(EntityUid? Entity, IShootable Shootable)> ammo,
|
||||
EntityCoordinates fromCoordinates, EntityCoordinates toCoordinates, EntityUid? user = null, bool throwItems = false)
|
||||
{
|
||||
// Rather than splitting client / server for every ammo provider it's easier
|
||||
// to just delete the spawned entities. This is for programmer sanity despite the wasted perf.
|
||||
@@ -178,6 +179,16 @@ public sealed partial class GunSystem : SharedGunSystem
|
||||
|
||||
foreach (var (ent, shootable) in ammo)
|
||||
{
|
||||
if (throwItems)
|
||||
{
|
||||
Recoil(user, direction);
|
||||
if (ent!.Value.IsClientSide())
|
||||
Del(ent.Value);
|
||||
else
|
||||
RemComp<AmmoComponent>(ent.Value);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (shootable)
|
||||
{
|
||||
case CartridgeAmmoComponent cartridge:
|
||||
|
||||
Reference in New Issue
Block a user