fix: don't divide by zero in FragmentIntoProjectiles (#38946)
This commit is contained in:
parent
5ba95f8c5b
commit
cfe825b0e3
1 changed files with 5 additions and 0 deletions
|
|
@ -58,6 +58,11 @@ public sealed class ProjectileGrenadeSystem : EntitySystem
|
|||
var grenadeCoord = _transformSystem.GetMapCoordinates(uid);
|
||||
var shootCount = 0;
|
||||
var totalCount = component.Container.ContainedEntities.Count + component.UnspawnedCount;
|
||||
|
||||
// Just in case
|
||||
if (totalCount == 0)
|
||||
return;
|
||||
|
||||
var segmentAngle = 360 / totalCount;
|
||||
|
||||
while (TrySpawnContents(grenadeCoord, component, out var contentUid))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue