From 73aced96aecaa8aa728eb9446f15ca7c7dc9441f Mon Sep 17 00:00:00 2001 From: Quillraven Date: Sun, 3 Dec 2023 17:26:08 +0100 Subject: [PATCH] fix family onRemoveHook order for global hook --- src/commonMain/kotlin/com/github/quillraven/fleks/world.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) } }