Content update for NetEntities (#18935)

This commit is contained in:
metalgearsloth
2023-09-11 09:42:41 +10:00
committed by GitHub
parent 389c8d1a2c
commit 5a0fc68be2
526 changed files with 3058 additions and 2215 deletions

View File

@@ -93,7 +93,7 @@ public sealed class GeigerSystem : SharedGeigerSystem
CurrentRadiation = component.CurrentRadiation,
DangerLevel = component.DangerLevel,
IsEnabled = component.IsEnabled,
User = component.User
User = GetNetEntity(component.User)
};
}

View File

@@ -56,18 +56,14 @@ public partial class RadiationSystem
if (_debugSessions.Count == 0)
return;
var query = GetEntityQuery<RadiationGridResistanceComponent>();
var dict = new Dictionary<EntityUid, Dictionary<Vector2i, float>>();
var dict = new Dictionary<NetEntity, Dictionary<Vector2i, float>>();
var gridQuery = AllEntityQuery<MapGridComponent>();
var gridQuery = AllEntityQuery<MapGridComponent, RadiationGridResistanceComponent>();
while (gridQuery.MoveNext(out var gridUid, out var grid))
while (gridQuery.MoveNext(out var gridUid, out _, out var resistance))
{
if (!query.TryGetComponent(gridUid, out var resistance))
continue;
var resMap = resistance.ResistancePerTile;
dict.Add(gridUid, resMap);
dict.Add(GetNetEntity(gridUid), resMap);
}
var ev = new OnRadiationOverlayResistanceUpdateEvent(dict);

View File

@@ -122,7 +122,7 @@ public partial class RadiationSystem
// create a new radiation ray from source to destination
// at first we assume that it doesn't hit any radiation blockers
// and has only distance penalty
var ray = new RadiationRay(mapId, sourceUid, sourceWorld, destUid, destWorld, rads);
var ray = new RadiationRay(mapId, GetNetEntity(sourceUid), sourceWorld, GetNetEntity(destUid), destWorld, rads);
// if source and destination on the same grid it's possible that
// between them can be another grid (ie. shuttle in center of donut station)
@@ -214,7 +214,7 @@ public partial class RadiationSystem
// save data for debug if needed
if (saveVisitedTiles && blockers.Count > 0)
ray.Blockers.Add(gridUid, blockers);
ray.Blockers.Add(GetNetEntity(gridUid), blockers);
return ray;
}