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

@@ -47,7 +47,7 @@ public partial class SharedGunSystem
args.State = new RevolverAmmoProviderComponentState
{
CurrentIndex = component.CurrentIndex,
AmmoSlots = component.AmmoSlots,
AmmoSlots = GetNetEntityList(component.AmmoSlots),
Chambers = component.Chambers,
};
}
@@ -64,7 +64,7 @@ public partial class SharedGunSystem
// Need to copy across the state rather than the ref.
for (var i = 0; i < component.AmmoSlots.Count; i++)
{
component.AmmoSlots[i] = state.AmmoSlots[i];
component.AmmoSlots[i] = EnsureEntity<RevolverAmmoProviderComponent>(state.AmmoSlots[i], uid);
component.Chambers[i] = state.Chambers[i];
}
@@ -416,7 +416,7 @@ public partial class SharedGunSystem
protected sealed class RevolverAmmoProviderComponentState : ComponentState
{
public int CurrentIndex;
public List<EntityUid?> AmmoSlots = default!;
public List<NetEntity?> AmmoSlots = default!;
public bool?[] Chambers = default!;
}