(50c0271)
[carveJwlIkooP6JGAAIwe30JlM.git] / world_gate.c
index 26ce0924ff39dcb2f7d83fcbd472b8665750a13b..2a236d4391c0d8d7f67d8bcc94bcbad42151a787 100644 (file)
@@ -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; j<mdl_arrcount(&world->ent_gate); j ++ ){
+   for( u32 j=0; j<mdl_arrcount(&world->ent_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;
       }
    }