Skip to content

Commit 950cebd

Browse files
committed
cherry-pick fix
1 parent dd253d6 commit 950cebd

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Content.Server/Spawners/EntitySystems/ConditionalSpawnerSystem.cs

+12-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,18 @@ private void Spawn(EntityUid uid, ConditionalSpawnerComponent component)
8989
return;
9090
}
9191

92-
if (!Deleted(uid))
93-
EntityManager.SpawnEntity(_robustRandom.Pick(component.Prototypes), Transform(uid).Coordinates);
92+
if (Deleted(uid))
93+
return;
94+
95+
var picked = _robustRandom.Pick(component.Prototypes);
96+
try
97+
{
98+
EntityManager.SpawnEntity(picked, coordinates);
99+
}
100+
catch (EntityCreationException e)
101+
{
102+
Log.Warning($"Caught an exception while trying to process a conditional spawner {ToPrettyString(uid)} of type {picked}: {e}");
103+
}
94104
}
95105

96106
private void Spawn(EntityUid uid, RandomSpawnerComponent component)

0 commit comments

Comments
 (0)