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:
Vera Aguilera Puerto
2021-10-23 10:56:37 +02:00
parent dad471562d
commit a29bc600b7
2 changed files with 3 additions and 2 deletions

View File

@@ -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;

View File

@@ -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;