Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
Fix error on spawn when categorizing entities not registered with geary
Browse files Browse the repository at this point in the history
  • Loading branch information
0ffz committed Nov 26, 2023
1 parent 0a7290f commit 26fa305
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class SpawnInfo(
companion object {
//TODO perhaps give normal mobs prefab keys too to make this more type safe
fun categorizeByType(mobs: Collection<Entity>): Map<PrefabKey?, Int> =
mobs.groupingBy { it.toGeary().prefabs.first().get<PrefabKey>() }.eachCount()
mobs.groupingBy { it.toGeary().prefabs.firstOrNull()?.get<PrefabKey>() }.eachCount()
}
}

0 comments on commit 26fa305

Please sign in to comment.