@@ -45,8 +45,8 @@ public abstract class SharedRingerSystem : EntitySystem
|
||||
/// <inheritdoc/>
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
var ringerQuery = EntityQueryEnumerator<RingerComponent>();
|
||||
while (ringerQuery.MoveNext(out var uid, out var ringer))
|
||||
var ringerQuery = EntityQueryEnumerator<RingerComponent, TransformComponent>();
|
||||
while (ringerQuery.MoveNext(out var uid, out var ringer, out var xform))
|
||||
{
|
||||
if (!ringer.Active || !ringer.NextNoteTime.HasValue)
|
||||
continue;
|
||||
@@ -63,10 +63,9 @@ public abstract class SharedRingerSystem : EntitySystem
|
||||
// and play it separately with PlayLocal, so that it's actually predicted
|
||||
if (_net.IsServer)
|
||||
{
|
||||
var ringerXform = Transform(uid);
|
||||
_audio.PlayEntity(
|
||||
GetSound(ringer.Ringtone[ringer.NoteCount]),
|
||||
Filter.Empty().AddInRange(_xform.GetMapCoordinates(uid, ringerXform), ringer.Range),
|
||||
Filter.Empty().AddInRange(_xform.GetMapCoordinates(uid, xform), ringer.Range),
|
||||
uid,
|
||||
true,
|
||||
AudioParams.Default.WithMaxDistance(ringer.Range).WithVolume(ringer.Volume)
|
||||
@@ -257,14 +256,6 @@ public abstract class SharedRingerSystem : EntitySystem
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to determine if the mind is an antagonist.
|
||||
/// </summary>
|
||||
protected bool IsAntagonist(EntityUid? user)
|
||||
{
|
||||
return user != null && _mind.TryGetMind(user.Value, out var mindId, out _) && _role.MindIsAntagonist(mindId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the sound path for a specific note.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user