Skip to content

Commit

Permalink
fix SpawnEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
Fansana committed Dec 31, 2024
1 parent 54b8c13 commit 758007b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ protected async Task<EntityUid> SpawnEntity(EntitySpecifier spec, EntityCoordina
{
await Server.WaitPost(() =>
{
uid = SEntMan.SpawnEntity(stackProto.Spawn, coords);
uid = SEntMan.SpawnAtPosition(stackProto.Spawn, coords);
Stack.SetCount(uid, spec.Quantity);
});
return uid;
Expand All @@ -114,13 +114,13 @@ await Server.WaitPost(() =>
return await SpawnEntity((stack.StackTypeId, spec.Quantity), coords);

Assert.That(spec.Quantity, Is.EqualTo(1), "SpawnEntity only supports returning a singular entity");
await Server.WaitPost(() => uid = SEntMan.SpawnEntity(spec.Prototype, coords));
await Server.WaitPost(() => uid = SEntMan.SpawnAtPosition(spec.Prototype, coords));
return uid;
}

/// <summary>
/// Convert an entity-uid to a matching entity specifier. Useful when doing entity lookups & checking that the
/// right quantity of entities/materials werre produced. Returns null if passed an entity with a null prototype.
/// right quantity of entities/materials were produced. Returns null if passed an entity with a null prototype.
/// </summary>
protected EntitySpecifier? ToEntitySpecifier(EntityUid uid)
{
Expand Down

0 comments on commit 758007b

Please sign in to comment.