mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
Fix antag verb incorrectly giving role to admin player instead of target (#27584)
Fix antag verb giving role to admin player instead of target
This commit is contained in:
parent
6e1f0ba390
commit
648472233c
1 changed files with 7 additions and 5 deletions
|
|
@ -44,9 +44,11 @@ public sealed partial class AdminVerbSystem
|
|||
if (!_adminManager.HasAdminFlag(player, AdminFlags.Fun))
|
||||
return;
|
||||
|
||||
if (!HasComp<MindContainerComponent>(args.Target))
|
||||
if (!HasComp<MindContainerComponent>(args.Target) || !TryComp<ActorComponent>(args.Target, out var targetActor))
|
||||
return;
|
||||
|
||||
var targetPlayer = targetActor.PlayerSession;
|
||||
|
||||
Verb traitor = new()
|
||||
{
|
||||
Text = Loc.GetString("admin-verb-text-make-traitor"),
|
||||
|
|
@ -54,7 +56,7 @@ public sealed partial class AdminVerbSystem
|
|||
Icon = new SpriteSpecifier.Rsi(new ResPath("/Textures/Structures/Wallmounts/posters.rsi"), "poster5_contraband"),
|
||||
Act = () =>
|
||||
{
|
||||
_antag.ForceMakeAntag<TraitorRuleComponent>(player, DefaultTraitorRule);
|
||||
_antag.ForceMakeAntag<TraitorRuleComponent>(targetPlayer, DefaultTraitorRule);
|
||||
},
|
||||
Impact = LogImpact.High,
|
||||
Message = Loc.GetString("admin-verb-make-traitor"),
|
||||
|
|
@ -83,7 +85,7 @@ public sealed partial class AdminVerbSystem
|
|||
Icon = new SpriteSpecifier.Rsi(new("/Textures/Structures/Wallmounts/signs.rsi"), "radiation"),
|
||||
Act = () =>
|
||||
{
|
||||
_antag.ForceMakeAntag<NukeopsRuleComponent>(player, DefaultNukeOpRule);
|
||||
_antag.ForceMakeAntag<NukeopsRuleComponent>(targetPlayer, DefaultNukeOpRule);
|
||||
},
|
||||
Impact = LogImpact.High,
|
||||
Message = Loc.GetString("admin-verb-make-nuclear-operative"),
|
||||
|
|
@ -112,7 +114,7 @@ public sealed partial class AdminVerbSystem
|
|||
Icon = new SpriteSpecifier.Rsi(new("/Textures/Interface/Misc/job_icons.rsi"), "HeadRevolutionary"),
|
||||
Act = () =>
|
||||
{
|
||||
_antag.ForceMakeAntag<RevolutionaryRuleComponent>(player, DefaultRevsRule);
|
||||
_antag.ForceMakeAntag<RevolutionaryRuleComponent>(targetPlayer, DefaultRevsRule);
|
||||
},
|
||||
Impact = LogImpact.High,
|
||||
Message = Loc.GetString("admin-verb-make-head-rev"),
|
||||
|
|
@ -126,7 +128,7 @@ public sealed partial class AdminVerbSystem
|
|||
Icon = new SpriteSpecifier.Rsi(new ResPath("/Textures/Clothing/Hands/Gloves/Color/black.rsi"), "icon"),
|
||||
Act = () =>
|
||||
{
|
||||
_antag.ForceMakeAntag<ThiefRuleComponent>(player, DefaultThiefRule);
|
||||
_antag.ForceMakeAntag<ThiefRuleComponent>(targetPlayer, DefaultThiefRule);
|
||||
},
|
||||
Impact = LogImpact.High,
|
||||
Message = Loc.GetString("admin-verb-make-thief"),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue