Fix magboot mispredict (#7385)
This commit is contained in:
@@ -48,7 +48,9 @@ namespace Content.Shared.StatusEffect
|
||||
|
||||
private void OnGetState(EntityUid uid, StatusEffectsComponent component, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new StatusEffectsComponentState(component.ActiveEffects, component.AllowedEffects);
|
||||
// Using new(...) To avoid mispredictions due to MergeImplicitData. This will mean the server-side code is
|
||||
// slightly slower, and really this function should just be overridden by the client...
|
||||
args.State = new StatusEffectsComponentState(new(component.ActiveEffects), new(component.AllowedEffects));
|
||||
}
|
||||
|
||||
private void OnHandleState(EntityUid uid, StatusEffectsComponent component, ref ComponentHandleState args)
|
||||
@@ -77,8 +79,8 @@ namespace Content.Shared.StatusEffect
|
||||
}
|
||||
|
||||
var time = effect.Value.Cooldown.Item2 - effect.Value.Cooldown.Item1;
|
||||
//TODO: Not sure how to handle refresh here.
|
||||
TryAddStatusEffect(uid, effect.Key, time, true);
|
||||
|
||||
TryAddStatusEffect(uid, effect.Key, time, true, component);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user