Nullable grid Uid (#8798)

This commit is contained in:
Leon Friedrich
2022-06-20 12:14:35 +12:00
committed by GitHub
parent ef41cd5aa8
commit fa4c6f63f8
82 changed files with 318 additions and 242 deletions

View File

@@ -34,11 +34,11 @@ namespace Content.Server.Gravity.EntitySystems
public void AddAlert(AlertsComponent status)
{
var xform = Transform(status.Owner);
var alerts = _alerts.GetOrNew(xform.GridEntityId);
var alerts = _alerts.GetOrNew(xform.GridID);
alerts.Add(status);
if (_mapManager.TryGetGrid(xform.GridEntityId, out var grid))
if (_mapManager.TryGetGrid(xform.GridUid, out var grid))
{
if (EntityManager.GetComponent<GravityComponent>(grid.GridEntityId).Enabled)
{
@@ -53,7 +53,7 @@ namespace Content.Server.Gravity.EntitySystems
public void RemoveAlert(AlertsComponent status)
{
var grid = EntityManager.GetComponent<TransformComponent>(status.Owner).GridEntityId;
var grid = EntityManager.GetComponent<TransformComponent>(status.Owner).GridID;
if (!_alerts.TryGetValue(grid, out var statuses))
{
return;
@@ -109,7 +109,10 @@ namespace Content.Server.Gravity.EntitySystems
}
}
var newGrid = ev.Transform.GridEntityId;
if (ev.Transform.MapID == MapId.Nullspace)
return;
var newGrid = ev.Transform.GridID;
var newStatuses = _alerts.GetOrNew(newGrid);
newStatuses.Add(status);