@@ -4,6 +4,7 @@ using Content.Server.Mind;
|
||||
using Content.Shared.Mind;
|
||||
using Content.Shared.Roles;
|
||||
using Content.Shared.Roles.Jobs;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Server.Roles.Jobs;
|
||||
|
||||
@@ -14,6 +15,7 @@ public sealed class JobSystem : SharedJobSystem
|
||||
{
|
||||
[Dependency] private readonly IChatManager _chat = default!;
|
||||
[Dependency] private readonly MindSystem _mind = default!;
|
||||
[Dependency] private readonly ISharedPlayerManager _player = default!;
|
||||
[Dependency] private readonly RoleSystem _roles = default!;
|
||||
|
||||
public override void Initialize()
|
||||
@@ -42,7 +44,7 @@ public sealed class JobSystem : SharedJobSystem
|
||||
if (args.Silent)
|
||||
return;
|
||||
|
||||
if (!_mind.TryGetSession(mindId, out var session))
|
||||
if (!_player.TryGetSessionById(component.UserId, out var session))
|
||||
return;
|
||||
|
||||
if (!MindTryGetJob(mindId, out var prototype))
|
||||
|
||||
@@ -46,7 +46,7 @@ public sealed class RoleSystem : SharedRoleSystem
|
||||
|
||||
public void RoleUpdateMessage(MindComponent mind)
|
||||
{
|
||||
if (mind.Session is null)
|
||||
if (!Player.TryGetSessionById(mind.UserId, out var session))
|
||||
return;
|
||||
|
||||
if (!_proto.TryIndex(mind.RoleType, out var proto))
|
||||
@@ -55,8 +55,6 @@ public sealed class RoleSystem : SharedRoleSystem
|
||||
var roleText = Loc.GetString(proto.Name);
|
||||
var color = proto.Color;
|
||||
|
||||
var session = mind.Session;
|
||||
|
||||
//TODO add audio? Would need to be optional so it does not play on role changes that already come with their own audio
|
||||
// _audio.PlayGlobal(Sound, session);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user