Fix handcuffed entity deletion and a mind shutdown error. (#21825)
* Fix handcuffed deletion error * Fix mind shutdown error
This commit is contained in:
@@ -40,7 +40,7 @@ public sealed class MindSystem : SharedMindSystem
|
||||
if (mind.UserId is {} user)
|
||||
{
|
||||
UserMinds.Remove(user);
|
||||
if (_players.GetPlayerData(user).ContentData() is { } oldData)
|
||||
if (_players.TryGetPlayerData(user, out var data) && data.ContentData() is { } oldData)
|
||||
oldData.Mind = null;
|
||||
mind.UserId = null;
|
||||
}
|
||||
|
||||
@@ -619,6 +619,9 @@ namespace Content.Shared.Cuffs
|
||||
if (!Resolve(target, ref cuffable) || !Resolve(cuffsToRemove, ref cuff))
|
||||
return;
|
||||
|
||||
if (TerminatingOrDeleted(cuffsToRemove) || TerminatingOrDeleted(target))
|
||||
return;
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
var attempt = new UncuffAttemptEvent(user.Value, target);
|
||||
|
||||
Reference in New Issue
Block a user