This commit is contained in:
ShadowCommander
2023-06-18 11:33:19 -07:00
committed by GitHub
parent 8a943fb374
commit dd7032a860
85 changed files with 1432 additions and 711 deletions

View File

@@ -1,6 +1,7 @@
using Content.Server.Actions;
using Content.Server.Humanoid;
using Content.Server.Inventory;
using Content.Server.Mind;
using Content.Server.Mind.Commands;
using Content.Server.Mind.Components;
using Content.Server.Nutrition;
@@ -41,6 +42,7 @@ namespace Content.Server.Polymorph.Systems
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly TransformSystem _transform = default!;
[Dependency] private readonly MindSystem _mindSystem = default!;
private ISawmill _sawmill = default!;
@@ -230,8 +232,8 @@ namespace Content.Server.Polymorph.Systems
_humanoid.CloneAppearance(uid, child);
}
if (TryComp<MindComponent>(uid, out var mind) && mind.Mind != null)
mind.Mind.TransferTo(child);
if (_mindSystem.TryGetMind(uid, out var mind))
_mindSystem.TransferTo(mind, child);
//Ensures a map to banish the entity to
EnsurePausesdMap();
@@ -304,10 +306,8 @@ namespace Content.Server.Polymorph.Systems
}
}
if (TryComp<MindComponent>(uid, out var mind) && mind.Mind != null)
{
mind.Mind.TransferTo(parent);
}
if (_mindSystem.TryGetMind(uid, out var mind))
_mindSystem.TransferTo(mind, parent);
// if an item polymorph was picked up, put it back down after reverting
Transform(parent).AttachToGridOrMap();