Fix some mispredict reconciliation issues. (#6319)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Leon Friedrich
2022-01-31 05:34:48 +13:00
committed by GitHub
parent 90b2f716a4
commit d40bcc9168
15 changed files with 110 additions and 71 deletions

View File

@@ -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();