mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Avoid calling DirtyEntity() when repeatedly dirtying the same component. (#4797)
This commit is contained in:
@@ -369,6 +369,9 @@ namespace Robust.Shared.GameObjects
|
||||
if (component.LifeStage >= ComponentLifeStage.Removing || !component.NetSyncEnabled)
|
||||
return;
|
||||
|
||||
if (component.LastModifiedTick == CurrentTick)
|
||||
return;
|
||||
|
||||
DirtyEntity(uid, meta);
|
||||
component.LastModifiedTick = CurrentTick;
|
||||
}
|
||||
@@ -382,6 +385,9 @@ namespace Robust.Shared.GameObjects
|
||||
if (ent.Comp.LifeStage >= ComponentLifeStage.Removing || !ent.Comp.NetSyncEnabled)
|
||||
return;
|
||||
|
||||
if (ent.Comp.LastModifiedTick == CurrentTick)
|
||||
return;
|
||||
|
||||
DirtyEntity(ent, meta);
|
||||
ent.Comp.LastModifiedTick = CurrentTick;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user