X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=ent_relay.c;h=1f97584af5843f1b0384a73f9dde4bfc3be5339b;hb=304647a7672165dd35ffe54884ed9aedcc9bf363;hp=60144ab2ff1c4cf389b3ba50a15a27447f2d9a5e;hpb=44459e0aa734b6a090d60a309e29a9a2a232c731;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/ent_relay.c b/ent_relay.c index 60144ab..1f97584 100644 --- a/ent_relay.c +++ b/ent_relay.c @@ -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; itargets); i++ ){ - if( relay->targets[i][0] ){ + if( call->function == 0 ) + { + for( u32 i=0; itargets); 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 */