update helpers/location to 'frosted' ui
[carveJwlIkooP6JGAAIwe30JlM.git] / ent_relay.c
index 60144ab2ff1c4cf389b3ba50a15a27447f2d9a5e..1f97584af5843f1b0384a73f9dde4bfc3be5339b 100644 (file)
@@ -1,15 +1,16 @@
-#ifndef ENT_RELAY_C
-#define ENT_RELAY_C
+#include "ent_relay.h"
 
-#include "entity.h"
-
-VG_STATIC void ent_relay_call( world_instance *world, ent_call *call ){
+entity_call_result ent_relay_call( world_instance *world, ent_call *call )
+{
    u32 index = mdl_entity_id_id( call->id );
    ent_relay *relay = mdl_arritm( &world->ent_relay, index );
 
-   if( call->function == 0 ){
-      for( u32 i=0; i<vg_list_size(relay->targets); i++ ){
-         if( relay->targets[i][0] ){
+   if( call->function == 0 )
+   {
+      for( u32 i=0; i<vg_list_size(relay->targets); i++ )
+      {
+         if( relay->targets[i][0] )
+         {
             ent_call call;
             call.data = NULL;
             call.function = relay->targets[i][1];
@@ -17,11 +18,8 @@ VG_STATIC void ent_relay_call( world_instance *world, ent_call *call ){
             entity_call( world, &call );
          }
       }
+      return k_entity_call_result_OK;
    }
-   else {
-      vg_print_backtrace();
-      vg_error( "Unhandled function id: %u\n", call->function );
-   }
+   else 
+      return k_entity_call_result_unhandled;
 }
-
-#endif /* ENT_RELAY_C */