Fix RotateWhilePulling not working (#29032)
This commit is contained in:
@@ -61,6 +61,7 @@ public sealed class PullingSystem : EntitySystem
|
||||
SubscribeLocalEvent<PullableComponent, EntGotInsertedIntoContainerMessage>(OnPullableContainerInsert);
|
||||
SubscribeLocalEvent<PullableComponent, ModifyUncuffDurationEvent>(OnModifyUncuffDuration);
|
||||
|
||||
SubscribeLocalEvent<PullerComponent, AfterAutoHandleStateEvent>(OnAfterState);
|
||||
SubscribeLocalEvent<PullerComponent, EntGotInsertedIntoContainerMessage>(OnPullerContainerInsert);
|
||||
SubscribeLocalEvent<PullerComponent, EntityUnpausedEvent>(OnPullerUnpaused);
|
||||
SubscribeLocalEvent<PullerComponent, VirtualItemDeletedEvent>(OnVirtualItemDeleted);
|
||||
@@ -72,6 +73,14 @@ public sealed class PullingSystem : EntitySystem
|
||||
.Register<PullingSystem>();
|
||||
}
|
||||
|
||||
private void OnAfterState(Entity<PullerComponent> ent, ref AfterAutoHandleStateEvent args)
|
||||
{
|
||||
if (ent.Comp.Pulling == null)
|
||||
RemComp<ActivePullerComponent>(ent.Owner);
|
||||
else
|
||||
EnsureComp<ActivePullerComponent>(ent.Owner);
|
||||
}
|
||||
|
||||
private void OnDropHandItems(EntityUid uid, PullerComponent pullerComp, DropHandItemsEvent args)
|
||||
{
|
||||
if (pullerComp.Pulling == null || pullerComp.NeedsHands)
|
||||
@@ -228,6 +237,9 @@ public sealed class PullingSystem : EntitySystem
|
||||
}
|
||||
|
||||
var oldPuller = pullableComp.Puller;
|
||||
if (oldPuller != null)
|
||||
RemComp<ActivePullerComponent>(oldPuller.Value);
|
||||
|
||||
pullableComp.PullJointId = null;
|
||||
pullableComp.Puller = null;
|
||||
Dirty(pullableUid, pullableComp);
|
||||
@@ -410,6 +422,7 @@ public sealed class PullingSystem : EntitySystem
|
||||
// Use net entity so it's consistent across client and server.
|
||||
pullableComp.PullJointId = $"pull-joint-{GetNetEntity(pullableUid)}";
|
||||
|
||||
EnsureComp<ActivePullerComponent>(pullerUid);
|
||||
pullerComp.Pulling = pullableUid;
|
||||
pullableComp.Puller = pullerUid;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user