Mind Swap Fix (#33553)

* Stores owned by mind instead of body

* Requested changes, traitor uplink fixed

* Store, listings fixed and now use Entity<MindComponent>

* Removed duplicate code

* test change

* test change 2

* back to mind entityuid

* MilonPL requested minor changes

* ScarKy0 requested changes
This commit is contained in:
ActiveMammmoth
2025-02-04 11:25:54 -05:00
committed by GitHub
parent 1d5b01190d
commit 6a017ef17b
8 changed files with 32 additions and 22 deletions

View File

@@ -10,6 +10,7 @@ using JetBrains.Annotations;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using System.Linq;
using Content.Shared.Mind;
namespace Content.Server.Store.Systems;
@@ -69,10 +70,13 @@ public sealed partial class StoreSystem : EntitySystem
if (!component.OwnerOnly)
return;
component.AccountOwner ??= args.User;
if (!_mind.TryGetMind(args.User, out var mind, out _))
return;
component.AccountOwner ??= mind;
DebugTools.Assert(component.AccountOwner != null);
if (component.AccountOwner == args.User)
if (component.AccountOwner == mind)
return;
_popup.PopupEntity(Loc.GetString("store-not-account-owner", ("store", uid)), uid, args.User);