Content mapmanager query changes (#16894)

This commit is contained in:
metalgearsloth
2023-05-28 23:22:44 +10:00
committed by GitHub
parent 16bf85f6e0
commit cd487b66e4
29 changed files with 60 additions and 61 deletions

View File

@@ -167,8 +167,8 @@ public sealed class MagicSystem : EntitySystem
{
// If applicable, this ensures the projectile is parented to grid on spawn, instead of the map.
var mapPos = pos.ToMap(EntityManager);
var spawnCoords = _mapManager.TryFindGridAt(mapPos, out var grid)
? pos.WithEntityId(grid.Owner, EntityManager)
var spawnCoords = _mapManager.TryFindGridAt(mapPos, out var gridUid, out _)
? pos.WithEntityId(gridUid, EntityManager)
: new(_mapManager.GetMapEntityId(mapPos.MapId), mapPos.Position);
var ent = Spawn(ev.Prototype, spawnCoords);