fix: don't divide by zero in FragmentIntoProjectiles (#38946)

This commit is contained in:
Perry Fraser
2025-07-12 15:49:46 -04:00
committed by GitHub
parent 5ba95f8c5b
commit cfe825b0e3

View File

@@ -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))