X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_gate.c;h=2a236d4391c0d8d7f67d8bcc94bcbad42151a787;hb=f01a25e33a54c92e4d6bca0889b76f33af5e51eb;hp=26ce0924ff39dcb2f7d83fcbd472b8665750a13b;hpb=fbe807d19b8a626c2d75002b286dd794f893473a;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_gate.c b/world_gate.c index 26ce092..2a236d4 100644 --- a/world_gate.c +++ b/world_gate.c @@ -295,17 +295,19 @@ u32 world_intersect_gates( world_instance *world, v3f pos, v3f last ) return 0; } -void ent_gate_call( world_instance *world, ent_call *call ) +entity_call_result ent_gate_call( world_instance *world, ent_call *call ) { u32 index = mdl_entity_id_id( call->id ); ent_gate *gate = mdl_arritm( &world->ent_gate, index ); - if( call->function == 0 ){ /* unlock() */ + if( call->function == 0 ) /* unlock() */ + { gate->flags &= ~k_ent_gate_locked; + 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; } } @@ -315,10 +317,12 @@ void ent_gate_call( world_instance *world, ent_call *call ) */ void world_unlink_nonlocal( world_instance *world ) { - for( u32 j=0; jent_gate); j ++ ){ + for( u32 j=0; jent_gate); j ++ ) + { ent_gate *gate = mdl_arritm( &world->ent_gate, j ); - if( gate->flags & k_ent_gate_nonlocal ){ + if( gate->flags & k_ent_gate_nonlocal ) + { gate->flags &= ~k_ent_gate_linked; } }