mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Fix component removal / PVS bugs (#3275)
This commit is contained in:
@@ -37,6 +37,9 @@ internal sealed class ClientDirtySystem : EntitySystem
|
||||
|
||||
private void OnCompRemoved(RemovedComponentEventArgs args)
|
||||
{
|
||||
if (args.Terminating)
|
||||
return;
|
||||
|
||||
var comp = args.BaseArgs.Component;
|
||||
if (!_timing.InPrediction || comp.Owner.IsClientSide() || !comp.NetSyncEnabled)
|
||||
return;
|
||||
@@ -45,12 +48,6 @@ internal sealed class ClientDirtySystem : EntitySystem
|
||||
if (comp.CreationTick > _timing.LastRealTick)
|
||||
return;
|
||||
|
||||
// TODO if entity deletion ever gets predicted, then to speed this function up the component removal event
|
||||
// should probably get an arg that specifies whether removal is occurring because of entity deletion. AKA: I
|
||||
// don't want to have to fetch the meta-data component 10+ times for each entity that gets deleted. Currently
|
||||
// server-induced deletions should get ignored, as _timing.InPrediction will be false while applying game
|
||||
// states.
|
||||
|
||||
var netId = _compFact.GetRegistration(comp).NetID;
|
||||
if (netId != null)
|
||||
RemovedComponents.GetOrNew(comp.Owner).Add(netId.Value);
|
||||
|
||||
Reference in New Issue
Block a user