Fix exception when observer tries to take over GhostTakeoverAvailable mob that has a mind.
That method is essentially a `TryTake` method, why would it throw instead of returning false...
This commit is contained in:
@@ -57,7 +57,8 @@ namespace Content.Server.Ghost.Roles.Components
|
|||||||
|
|
||||||
mind!.TransferTo(mob);
|
mind!.TransferTo(mob);
|
||||||
|
|
||||||
if (++_currentTakeovers < _availableTakeovers) return true;
|
if (++_currentTakeovers < _availableTakeovers)
|
||||||
|
return true;
|
||||||
|
|
||||||
Taken = true;
|
Taken = true;
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace Content.Server.Ghost.Roles.Components
|
|||||||
var mind = Owner.EnsureComponent<MindComponent>();
|
var mind = Owner.EnsureComponent<MindComponent>();
|
||||||
|
|
||||||
if (mind.HasMind)
|
if (mind.HasMind)
|
||||||
throw new Exception("MindComponent already has a mind!");
|
return false;
|
||||||
|
|
||||||
var sessionMind = session.ContentData()?.Mind;
|
var sessionMind = session.ContentData()?.Mind;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user