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:
youtissoum
2025-05-03 21:19:32 +02:00
committed by GitHub
parent 0c8c757a42
commit 07460f9eda
3 changed files with 24 additions and 0 deletions

View File

@@ -343,6 +343,13 @@ public abstract class SharedEntityStorageSystem : EntitySystem
if (attemptEvent.Cancelled)
return false;
// Allow other components on the container to prevent inserting the item: e.g. the container is folded
var containerAttemptEvent = new EntityStorageInsertedIntoAttemptEvent(toInsert);
RaiseLocalEvent(container, ref containerAttemptEvent);
if (containerAttemptEvent.Cancelled)
return false;
// Consult the whitelist. The whitelist ignores the default assumption about how entity storage works.
if (component.Whitelist != null)
return _whitelistSystem.IsValid(component.Whitelist, toInsert);