Fix ControlMob on already controlled mob (#3868)

This commit is contained in:
ShadowCommander
2021-11-01 17:11:50 -07:00
committed by GitHub
parent fea41c539e
commit 0e33b246db
3 changed files with 2 additions and 4 deletions

View File

@@ -85,7 +85,6 @@ namespace Content.Server.Administration
// TODO VERB ICON control mob icon // TODO VERB ICON control mob icon
verb.Act = () => verb.Act = () =>
{ {
targetMind.Mind?.TransferTo(null);
player.ContentData()?.Mind?.TransferTo(args.Target, ghostCheckOverride: true); player.ContentData()?.Mind?.TransferTo(args.Target, ghostCheckOverride: true);
}; };
args.Verbs.Add(verb); args.Verbs.Add(verb);

View File

@@ -60,7 +60,6 @@ namespace Content.Server.Administration.Commands
DebugTools.AssertNotNull(mind); DebugTools.AssertNotNull(mind);
mindComponent.Mind?.TransferTo(null);
mind!.TransferTo(target); mind!.TransferTo(target);
} }
} }

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Linq; using System.Linq;
using Content.Server.GameTicking;
using Content.Server.Ghost.Components; using Content.Server.Ghost.Components;
using Content.Server.Mind.Components; using Content.Server.Mind.Components;
using Content.Server.Objectives; using Content.Server.Objectives;
@@ -254,8 +255,7 @@ namespace Content.Server.Mind
} }
else if (component.HasMind) else if (component.HasMind)
{ {
// TODO: Kick them out, maybe? EntitySystem.Get<GameTicker>().OnGhostAttempt(component.Mind!, false);
throw new ArgumentException("That entity already has a mind.", nameof(entity));
} }
if (entity.TryGetComponent(out ActorComponent? actor)) if (entity.TryGetComponent(out ActorComponent? actor))