Limit maximum capacity of fillable cluster grenades (#34281)
* Limit maximum capacity of fillable cluster grenades * Swap GrenadeCount method for component property
This commit is contained in:
@@ -27,7 +27,7 @@ public sealed partial class ScatteringGrenadeComponent : Component
|
||||
/// <summary>
|
||||
/// If we have a pre-fill how many more can we spawn.
|
||||
/// </summary>
|
||||
[AutoNetworkedField]
|
||||
[ViewVariables(VVAccess.ReadOnly), AutoNetworkedField]
|
||||
public int UnspawnedCount;
|
||||
|
||||
/// <summary>
|
||||
@@ -36,6 +36,12 @@ public sealed partial class ScatteringGrenadeComponent : Component
|
||||
[DataField]
|
||||
public int Capacity = 3;
|
||||
|
||||
/// <summary>
|
||||
/// Number of grenades currently contained in the cluster (both spawned and unspawned)
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadOnly)]
|
||||
public int Count => UnspawnedCount + Container.ContainedEntities.Count;
|
||||
|
||||
/// <summary>
|
||||
/// Decides if contained entities trigger after getting launched
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user