Fix ControlMob on already controlled mob (#3868)
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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))
|
||||||
|
|||||||
Reference in New Issue
Block a user