Windows libraries for getaddrinfo
[carveJwlIkooP6JGAAIwe30JlM.git] / ent_skateshop.c
index d5128f0302a447f77ffb5d439bbb65512689edc3..05999f9322c5793df9cccb00c7e547f14c03b460 100644 (file)
@@ -209,12 +209,13 @@ static void skateshop_server_helper_update(void){
  * VG event preupdate 
  */
 void temp_update_playermodel(void);
-void ent_skateshop_preupdate( ent_skateshop *shop, int active )
+void ent_skateshop_preupdate( ent_focus_context *ctx )
 {
-   if( !active ) return;
+   if( !ctx->active ) 
+      return;
 
-   /* input filter */
-   world_instance *world = world_current_instance();
+   world_instance *world = ctx->world;
+   ent_skateshop *shop = mdl_arritm( &world->ent_skateshop, ctx->index );
 
    /* camera positioning */
    ent_camera *ref = mdl_arritm( &world->ent_camera, 
@@ -797,18 +798,20 @@ static void world_scan_thread( void *_args )
 /*
  * Entity logic: entrance event
  */
-void ent_skateshop_call( world_instance *world, ent_call *call )
+entity_call_result ent_skateshop_call( world_instance *world, ent_call *call )
 {
    u32 index = mdl_entity_id_id( call->id );
    ent_skateshop *shop = mdl_arritm( &world->ent_skateshop, index );
    vg_info( "skateshop_call\n" );
 
-   if( skaterift.activity != k_skaterift_default ) return;
-   if( !vg_loader_availible() ) return;
+   if( (skaterift.activity != k_skaterift_default) || 
+       !vg_loader_availible() ) 
+      return k_entity_call_result_invalid;
 
    if( call->function == k_ent_function_trigger )
    {
-      if( localplayer.subsystem != k_player_subsystem_walk ) return;
+      if( localplayer.subsystem != k_player_subsystem_walk )
+         return k_entity_call_result_OK;
       
       vg_info( "Entering skateshop\n" );
 
@@ -840,5 +843,8 @@ void ent_skateshop_call( world_instance *world, ent_call *call )
             vg_strcat( &text, "exit" );
          skateshop_server_helper_update();
       }
+      return k_entity_call_result_OK;
    }
+   else
+      return k_entity_call_result_unhandled;
 }