Shotgun spread refactor (#27773)

* Moves spread data to new component

* Refactors shotgun spread code

* Makes shotgun cartridges and projectiles use new component

* Attempts to fix nullable build error

* Fixes hitscan weapons that I broke :(

* Saviour commit?

---------

Co-authored-by: EmoGarbage404 <retron404@gmail.com>
This commit is contained in:
RiceMar1244
2024-08-03 09:26:32 -04:00
committed by GitHub
parent 64273cb914
commit b432dc6125
6 changed files with 144 additions and 61 deletions

View File

@@ -30,18 +30,6 @@ public sealed partial class CartridgeAmmoComponent : AmmoComponent
[AutoNetworkedField]
public bool Spent = false;
/// <summary>
/// How much the ammo spreads when shot, in degrees. Does nothing if count is 0.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("spread")]
public Angle Spread = Angle.FromDegrees(5);
/// <summary>
/// How many prototypes are spawned when shot.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("count")]
public int Count = 1;
/// <summary>
/// Caseless ammunition.
/// </summary>