src/behavior.c

changeset 162
d3598c834f9b
parent 148
9f030f402699
--- a/src/behavior.c	Sat Jun 21 22:10:54 2025 +0200
+++ b/src/behavior.c	Sun Jun 22 11:15:53 2025 +0200
@@ -27,12 +27,13 @@
 
 #include "ascension/behavior.h"
 #include "ascension/context.h"
-#include "ascension/error.h"
 #include "ascension/scene.h"
 
 #include <cx/array_list.h>
 #include <cx/tree.h>
 
+#include <assert.h>
+
 static void asc_behavior_destroy(void *b) {
     AscBehavior *behavior = b;
     if (behavior->destroy_func) {
@@ -52,11 +53,7 @@
         node->behaviors = asc_behavior_new_list();
     }
     AscBehavior *behavior = cxListEmplace(node->behaviors);
-    if (behavior == NULL) {
-        const cxstring node_name = asc_scene_node_get_name(node);
-        asc_error("Failed to add behavior to scene node %"CX_PRIstr, CX_SFMT(node_name));
-        return NULL;
-    }
+    assert(behavior != NULL);
     behavior->enabled = true;
     behavior->node = node;
     behavior->func = args.func;

mercurial