mirror of
https://github.com/wega-team/ss14-wega.git
synced 2026-02-15 03:31:44 +01:00
Fix: Make `IdBindComponent change ID card on MapInitEvent` (#37300)
Fix
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
using Content.Server.Access.Components;
|
||||
using Content.Server.Humanoid.Systems;
|
||||
using Content.Server.PDA;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Mind.Components;
|
||||
using Content.Shared.PDA;
|
||||
using Content.Shared.Roles;
|
||||
|
||||
namespace Content.Server.Access.Systems;
|
||||
|
||||
@@ -17,10 +16,10 @@ public sealed class IdBindSystem : EntitySystem
|
||||
{
|
||||
base.Initialize();
|
||||
//Activate on mind being added
|
||||
SubscribeLocalEvent<IdBindComponent, MindAddedMessage>(TryBind);
|
||||
SubscribeLocalEvent<IdBindComponent, MapInitEvent>(TryBind, after: [typeof(RandomHumanoidSystem)]);
|
||||
}
|
||||
|
||||
private void TryBind(Entity<IdBindComponent> ent, ref MindAddedMessage args)
|
||||
private void TryBind(Entity<IdBindComponent> ent, ref MapInitEvent args)
|
||||
{
|
||||
if (!_cardSystem.TryFindIdCard(ent, out var cardId))
|
||||
return;
|
||||
@@ -31,9 +30,9 @@ public sealed class IdBindSystem : EntitySystem
|
||||
|
||||
if (!ent.Comp.BindPDAOwner)
|
||||
{
|
||||
//Remove after running once
|
||||
RemCompDeferred<IdBindComponent>(ent);
|
||||
return;
|
||||
//Remove after running once
|
||||
RemCompDeferred<IdBindComponent>(ent);
|
||||
return;
|
||||
}
|
||||
|
||||
//Get PDA from main slot and set us as owner
|
||||
|
||||
Reference in New Issue
Block a user