pneumatic cannon fixes (#14705)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -37,6 +37,12 @@ public sealed class PneumaticCannonComponent : Component
|
||||
/// </summary>
|
||||
[DataField("baseProjectileSpeed")]
|
||||
public float BaseProjectileSpeed = 20f;
|
||||
|
||||
/// <summary>
|
||||
/// If true, will throw ammo rather than shoot it.
|
||||
/// </summary>
|
||||
[DataField("throwItems"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public bool ThrowItems = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -20,6 +20,13 @@ public abstract class SharedPneumaticCannonSystem : EntitySystem
|
||||
|
||||
private void OnAttemptShoot(EntityUid uid, PneumaticCannonComponent component, ref AttemptShootEvent args)
|
||||
{
|
||||
// if the cannon doesn't need gas then it will always predict firing
|
||||
if (component.GasUsage == 0f)
|
||||
return;
|
||||
|
||||
// pneumatic cannon usually doesn't shoot bullets
|
||||
args.ThrowItems = component.ThrowItems;
|
||||
|
||||
// we don't have atmos on shared, so just predict by the existence of a slot item
|
||||
// server will handle auto ejecting/not adding the slot item if it doesnt have enough gas,
|
||||
// so this won't mispredict
|
||||
|
||||
Reference in New Issue
Block a user