Fix some mispredict reconciliation issues. (#6319)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -87,7 +87,10 @@ namespace Content.Shared.Damage
|
||||
component.Dirty();
|
||||
|
||||
if (EntityManager.TryGetComponent<AppearanceComponent>(component.Owner, out var appearance) && damageDelta != null)
|
||||
appearance.SetData(DamageVisualizerKeys.DamageUpdateGroups, damageDelta.GetDamagePerGroup().Keys.ToList());
|
||||
{
|
||||
var data = new DamageVisualizerGroupData(damageDelta.GetDamagePerGroup().Keys.ToList());
|
||||
appearance.SetData(DamageVisualizerKeys.DamageUpdateGroups, data);
|
||||
}
|
||||
RaiseLocalEvent(component.Owner, new DamageChangedEvent(component, damageDelta, interruptsDoAfters), false);
|
||||
}
|
||||
|
||||
@@ -198,7 +201,7 @@ namespace Content.Shared.Damage
|
||||
component.DamageModifierSetId = state.ModifierSetId;
|
||||
|
||||
// Has the damage actually changed?
|
||||
DamageSpecifier newDamage = new() { DamageDict = state.DamageDict };
|
||||
DamageSpecifier newDamage = new() { DamageDict = new(state.DamageDict) };
|
||||
var delta = component.Damage - newDamage;
|
||||
delta.TrimZeros();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user