Update content for physics query namespace change (#4701)

This commit is contained in:
metalgearsloth
2021-10-10 14:18:19 +11:00
committed by GitHub
parent 801033b582
commit f0f7cd0e76
11 changed files with 17 additions and 54 deletions

View File

@@ -16,9 +16,9 @@ namespace Content.Shared.Spawning
EntityCoordinates coordinates,
CollisionGroup collisionLayer,
in Box2? box = null,
SharedBroadphaseSystem? physicsManager = null)
SharedPhysicsSystem? physicsManager = null)
{
physicsManager ??= EntitySystem.Get<SharedBroadphaseSystem>();
physicsManager ??= EntitySystem.Get<SharedPhysicsSystem>();
var mapCoordinates = coordinates.ToMap(entityManager);
return entityManager.SpawnIfUnobstructed(prototypeName, mapCoordinates, collisionLayer, box, physicsManager);
@@ -30,10 +30,10 @@ namespace Content.Shared.Spawning
MapCoordinates coordinates,
CollisionGroup collisionLayer,
in Box2? box = null,
SharedBroadphaseSystem? collision = null)
SharedPhysicsSystem? collision = null)
{
var boxOrDefault = box.GetValueOrDefault(Box2.UnitCentered).Translated(coordinates.Position);
collision ??= EntitySystem.Get<SharedBroadphaseSystem>();
collision ??= EntitySystem.Get<SharedPhysicsSystem>();
foreach (var body in collision.GetCollidingEntities(coordinates.MapId, in boxOrDefault))
{
@@ -61,7 +61,7 @@ namespace Content.Shared.Spawning
CollisionGroup collisionLayer,
[NotNullWhen(true)] out IEntity? entity,
Box2? box = null,
SharedBroadphaseSystem? physicsManager = null)
SharedPhysicsSystem? physicsManager = null)
{
entity = entityManager.SpawnIfUnobstructed(prototypeName, coordinates, collisionLayer, box, physicsManager);
@@ -75,7 +75,7 @@ namespace Content.Shared.Spawning
CollisionGroup collisionLayer,
[NotNullWhen(true)] out IEntity? entity,
in Box2? box = null,
SharedBroadphaseSystem? physicsManager = null)
SharedPhysicsSystem? physicsManager = null)
{
entity = entityManager.SpawnIfUnobstructed(prototypeName, coordinates, collisionLayer, box, physicsManager);