Fix nukies sound not played (#21268)
* Play sound and sending greeting message works for nukies now!!!!! * oops * silly change
This commit is contained in:
@@ -46,6 +46,7 @@ using Robust.Server.Player;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Timing;
|
||||
@@ -334,7 +335,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
||||
var eligibleQuery = EntityQueryEnumerator<StationEventEligibleComponent, NpcFactionMemberComponent>();
|
||||
while (eligibleQuery.MoveNext(out var eligibleUid, out var eligibleComp, out var member))
|
||||
{
|
||||
if (!_npcFaction.IsFactionFriendly(component.Faction, eligibleUid, member))
|
||||
if (!_npcFaction.IsFactionHostile(component.Faction, eligibleUid, member))
|
||||
continue;
|
||||
|
||||
eligible.Add((eligibleUid, eligibleComp, member));
|
||||
@@ -349,8 +350,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
||||
var query = EntityQueryEnumerator<NukeOperativeComponent, ActorComponent>();
|
||||
while (query.MoveNext(out _, out var nukeops, out var actor))
|
||||
{
|
||||
_chatManager.DispatchServerMessage(actor.PlayerSession, Loc.GetString("nukeops-welcome", ("station", component.TargetStation.Value)));
|
||||
_audio.PlayGlobal(nukeops.GreetSoundNotification, actor.PlayerSession);
|
||||
NotifyNukie(actor.PlayerSession, nukeops, component);
|
||||
filter.AddPlayer(actor.PlayerSession);
|
||||
}
|
||||
}
|
||||
@@ -793,10 +793,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
||||
|
||||
if (nukeops.TargetStation != null && !string.IsNullOrEmpty(Name(nukeops.TargetStation.Value)))
|
||||
{
|
||||
_chatManager.DispatchServerMessage(playerSession, Loc.GetString("nukeops-welcome", ("station", nukeops.TargetStation.Value)));
|
||||
|
||||
// Notificate player about new role assignment
|
||||
_audio.PlayGlobal(component.GreetSoundNotification, playerSession);
|
||||
NotifyNukie(playerSession, component, nukeops);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -994,6 +991,18 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
||||
SpawnOperatives(numNukies, operatives, true, component);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Display a greeting message and play a sound for a nukie
|
||||
/// </summary>
|
||||
private void NotifyNukie(ICommonSession session, NukeOperativeComponent nukeop, NukeopsRuleComponent nukeopsRule)
|
||||
{
|
||||
if (nukeopsRule.TargetStation is not { } station)
|
||||
return;
|
||||
|
||||
_chatManager.DispatchServerMessage(session, Loc.GetString("nukeops-welcome", ("station", station)));
|
||||
_audio.PlayGlobal(nukeop.GreetSoundNotification, session);
|
||||
}
|
||||
|
||||
//For admins forcing someone to nukeOps.
|
||||
public void MakeLoneNukie(EntityUid mindId, MindComponent mind)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user