Skip to content

Commit cf1b3b0

Browse files
authored
Merge spider clan charges can be armed again (space-wizards#32866) to Master (space-wizards#32881)
HOTFIX spider clan charges can be armed again (space-wizards#32866) * fix ninja bomb component check * remove TryGetRole
1 parent 304d1d5 commit cf1b3b0

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

‎Content.Server/Ninja/Systems/SpiderChargeSystem.cs‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
using Content.Server.Explosion.EntitySystems;
2-
using Content.Server.GameTicking.Rules.Components;
32
using Content.Server.Mind;
43
using Content.Server.Objectives.Components;
54
using Content.Server.Popups;
65
using Content.Server.Roles;
7-
using Content.Shared.Interaction;
86
using Content.Shared.Ninja.Components;
97
using Content.Shared.Ninja.Systems;
8+
using Content.Shared.Roles;
109
using Content.Shared.Sticky;
11-
using Robust.Shared.GameObjects;
1210

1311
namespace Content.Server.Ninja.Systems;
1412

@@ -19,6 +17,7 @@ public sealed class SpiderChargeSystem : SharedSpiderChargeSystem
1917
{
2018
[Dependency] private readonly MindSystem _mind = default!;
2119
[Dependency] private readonly PopupSystem _popup = default!;
20+
[Dependency] private readonly SharedRoleSystem _role = default!;
2221
[Dependency] private readonly SharedTransformSystem _transform = default!;
2322
[Dependency] private readonly SpaceNinjaSystem _ninja = default!;
2423

@@ -41,7 +40,10 @@ private void OnAttemptStick(EntityUid uid, SpiderChargeComponent comp, ref Attem
4140

4241
var user = args.User;
4342

44-
if (!_mind.TryGetRole<NinjaRoleComponent>(user, out var _))
43+
if (!_mind.TryGetMind(args.User, out var mind, out _))
44+
return;
45+
46+
if (!_role.MindHasRole<NinjaRoleComponent>(mind))
4547
{
4648
_popup.PopupEntity(Loc.GetString("spider-charge-not-ninja"), user, user);
4749
args.Cancelled = true;

‎Content.Shared/Mind/SharedMindSystem.cs‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -483,19 +483,6 @@ public bool TryGetMind(
483483
return false;
484484
}
485485

486-
/// <summary>
487-
/// Gets a role component from a player's mind.
488-
/// </summary>
489-
/// <returns>Whether a role was found</returns>
490-
public bool TryGetRole<T>(EntityUid user, [NotNullWhen(true)] out T? role) where T : IComponent
491-
{
492-
role = default;
493-
if (!TryComp<MindContainerComponent>(user, out var mindContainer) || mindContainer.Mind == null)
494-
return false;
495-
496-
return TryComp(mindContainer.Mind, out role);
497-
}
498-
499486
/// <summary>
500487
/// Sets the Mind's UserId, Session, and updates the player's PlayerData. This should have no direct effect on the
501488
/// entity that any mind is connected to, except as a side effect of the fact that it may change a player's

0 commit comments

Comments
 (0)