Fix skeletons spawning in folded body bags (#37151)
* Fix skeleton spawning * Add comments * Fix the comments Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
@@ -30,6 +30,7 @@ public sealed class FoldableSystem : EntitySystem
|
||||
SubscribeLocalEvent<FoldableComponent, ComponentInit>(OnFoldableInit);
|
||||
SubscribeLocalEvent<FoldableComponent, ContainerGettingInsertedAttemptEvent>(OnInsertEvent);
|
||||
SubscribeLocalEvent<FoldableComponent, StorageOpenAttemptEvent>(OnFoldableOpenAttempt);
|
||||
SubscribeLocalEvent<FoldableComponent, EntityStorageInsertedIntoAttemptEvent>(OnEntityStorageAttemptInsert);
|
||||
|
||||
SubscribeLocalEvent<FoldableComponent, StrapAttemptEvent>(OnStrapAttempt);
|
||||
}
|
||||
@@ -56,6 +57,13 @@ public sealed class FoldableSystem : EntitySystem
|
||||
args.Cancelled = true;
|
||||
}
|
||||
|
||||
private void OnEntityStorageAttemptInsert(Entity<FoldableComponent> entity,
|
||||
ref EntityStorageInsertedIntoAttemptEvent args)
|
||||
{
|
||||
if (entity.Comp.IsFolded)
|
||||
args.Cancelled = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns false if the entity isn't foldable.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user