diff --git a/src/commonMain/kotlin/com/github/quillraven/fleks/world.kt b/src/commonMain/kotlin/com/github/quillraven/fleks/world.kt index 1095665..6e93aaf 100644 --- a/src/commonMain/kotlin/com/github/quillraven/fleks/world.kt +++ b/src/commonMain/kotlin/com/github/quillraven/fleks/world.kt @@ -233,8 +233,8 @@ class WorldConfiguration(@PublishedApi internal val world: World) { val ownHook = family.removeHook val systemArray = systemList.toTypedArray() family.removeHook = if (ownHook != null) { entity -> - ownHook(world, entity) systemArray.forEachReverse { it.onRemoveEntity(entity) } + ownHook(world, entity) } else { entity -> systemArray.forEachReverse { it.onRemoveEntity(entity) } }