Move replacement chance from ReplacementAccentComponent to ReplacementAccentPrototype (#28049)
Move replacement chance to ReplacementAccentPrototype
This commit is contained in:
@@ -24,9 +24,6 @@ namespace Content.Server.Speech.EntitySystems
|
||||
|
||||
private void OnAccent(EntityUid uid, ReplacementAccentComponent component, AccentGetEvent args)
|
||||
{
|
||||
if (!_random.Prob(component.ReplacementChance))
|
||||
return;
|
||||
|
||||
args.Message = ApplyReplacements(args.Message, component.Accent);
|
||||
}
|
||||
|
||||
@@ -39,6 +36,9 @@ namespace Content.Server.Speech.EntitySystems
|
||||
if (!_proto.TryIndex<ReplacementAccentPrototype>(accent, out var prototype))
|
||||
return message;
|
||||
|
||||
if (!_random.Prob(prototype.ReplacementChance))
|
||||
return message;
|
||||
|
||||
// Prioritize fully replacing if that exists--
|
||||
// ideally both aren't used at the same time (but we don't have a way to enforce that in serialization yet)
|
||||
if (prototype.FullReplacements != null)
|
||||
|
||||
Reference in New Issue
Block a user