removed TryGetSound + made some SoundSpecifier datafields required
This commit is contained in:
@@ -231,13 +231,11 @@ namespace Content.Server.Cuffs.Components
|
||||
|
||||
if (isOwner)
|
||||
{
|
||||
if (cuff.StartBreakoutSound.TryGetSound(out var startBreakoutSound))
|
||||
SoundSystem.Play(Filter.Pvs(Owner), startBreakoutSound, Owner);
|
||||
SoundSystem.Play(Filter.Pvs(Owner), cuff.StartBreakoutSound.GetSound(), Owner);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cuff.StartUncuffSound.TryGetSound(out var startUncuffSound))
|
||||
SoundSystem.Play(Filter.Pvs(Owner), startUncuffSound, Owner);
|
||||
SoundSystem.Play(Filter.Pvs(Owner), cuff.StartUncuffSound.GetSound(), Owner);
|
||||
}
|
||||
|
||||
var uncuffTime = isOwner ? cuff.BreakoutTime : cuff.UncuffTime;
|
||||
@@ -258,8 +256,7 @@ namespace Content.Server.Cuffs.Components
|
||||
|
||||
if (result != DoAfterStatus.Cancelled)
|
||||
{
|
||||
if (cuff.EndUncuffSound.TryGetSound(out var endUncuffSound))
|
||||
SoundSystem.Play(Filter.Pvs(Owner), endUncuffSound, Owner);
|
||||
SoundSystem.Play(Filter.Pvs(Owner), cuff.EndUncuffSound.GetSound(), Owner);
|
||||
|
||||
Container.ForceRemove(cuffsToRemove);
|
||||
cuffsToRemove.Transform.AttachToGridOrMap();
|
||||
@@ -289,7 +286,7 @@ namespace Content.Server.Cuffs.Components
|
||||
|
||||
if (!isOwner)
|
||||
{
|
||||
user.PopupMessage(Owner, Loc.GetString("cuffable-component-remove-cuffs-by-other-success-message",("otherName", user)));
|
||||
user.PopupMessage(Owner, Loc.GetString("cuffable-component-remove-cuffs-by-other-success-message", ("otherName", user)));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -305,7 +302,7 @@ namespace Content.Server.Cuffs.Components
|
||||
}
|
||||
else
|
||||
{
|
||||
user.PopupMessage(Loc.GetString("cuffable-component-remove-cuffs-partial-success-message",("cuffedHandCount", CuffedHandCount)));
|
||||
user.PopupMessage(Loc.GetString("cuffable-component-remove-cuffs-partial-success-message", ("cuffedHandCount", CuffedHandCount)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,8 +184,7 @@ namespace Content.Server.Cuffs.Components
|
||||
eventArgs.User.PopupMessage(Loc.GetString("handcuff-component-start-cuffing-target-message",("targetName", eventArgs.Target)));
|
||||
eventArgs.User.PopupMessage(eventArgs.Target, Loc.GetString("handcuff-component-start-cuffing-by-other-message",("otherName", eventArgs.User)));
|
||||
|
||||
if (StartCuffSound.TryGetSound(out var startCuffSound))
|
||||
SoundSystem.Play(Filter.Pvs(Owner), startCuffSound, Owner);
|
||||
SoundSystem.Play(Filter.Pvs(Owner), StartCuffSound.GetSound(), Owner);
|
||||
|
||||
TryUpdateCuff(eventArgs.User, eventArgs.Target, cuffed);
|
||||
return true;
|
||||
@@ -222,8 +221,7 @@ namespace Content.Server.Cuffs.Components
|
||||
{
|
||||
if (cuffs.TryAddNewCuffs(user, Owner))
|
||||
{
|
||||
if (EndCuffSound.TryGetSound(out var endCuffSound))
|
||||
SoundSystem.Play(Filter.Pvs(Owner), endCuffSound, Owner);
|
||||
SoundSystem.Play(Filter.Pvs(Owner), EndCuffSound.GetSound(), Owner);
|
||||
|
||||
user.PopupMessage(Loc.GetString("handcuff-component-cuff-other-success-message",("otherName", target)));
|
||||
target.PopupMessage(Loc.GetString("handcuff-component-cuff-by-other-success-message", ("otherName", user)));
|
||||
|
||||
Reference in New Issue
Block a user