commit 9b9106ccb3187a43976359681388f348f98b058c
parent 93cd8e56f562a79df4eb478c3dcb87ed92796f5e
Author: bsandro <email@bsandro.tech>
Date: Wed, 30 Sep 2026 02:29:09 +0300
simulation end condition - 0 or 1 units left alive
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/systems/actions.c b/systems/actions.c
@@ -8,6 +8,7 @@
bool actions_run(World *w) {
//printf("actions_run world %p\n", (void *)w);
bool ret = false;
+ if (arrlen(w->entities)<=1) return ret; // finish condition = 1 or no units left alive.
for (int i=0;i<arrlen(w->entities);++i) {
Component *c = Entity_Find_Component(&w->entities[i], COMPONENT_ACTIONS);
if (c==NULL) continue;