X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=ent_objective.c;h=97e33d8cb5c54caf922fc167348a3b595c6f10eb;hb=c0e4a67ba2f001179df6e2cde97370a946669c22;hp=ff31c4f597beded3cf5a7d9822e8701f59c54b3c;hpb=4cc4130853138cb88531146e44d6981ec38bf862;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/ent_objective.c b/ent_objective.c index ff31c4f..97e33d8 100644 --- a/ent_objective.c +++ b/ent_objective.c @@ -7,7 +7,7 @@ #include "audio.h" #include "steam.h" -VG_STATIC void ent_objective_pass( world_instance *world, +static void ent_objective_pass( world_instance *world, ent_objective *objective ){ if( objective->id_next ){ world_static.challenge_timer += objective->filter; @@ -21,13 +21,17 @@ VG_STATIC void ent_objective_pass( world_instance *world, ent_objective_pass( world, next ); else{ vg_info( "pass challenge point\n" ); + audio_lock(); audio_oneshot_3d( &audio_challenge[0], localplayer.rb.co, 30.0f, 1.0f ); + audio_unlock(); } } else { vg_success( "challenge win\n" ); + audio_lock(); audio_oneshot( &audio_challenge[2], 1.0f, 0.0f ); + audio_unlock(); world_static.challenge_target = NULL; world_static.challenge_timer = 0.0f; world_static.focused_entity = 0; @@ -54,14 +58,15 @@ VG_STATIC void ent_objective_pass( world_instance *world, if( mdl_pstreq( &world->meta, world->info.pstr_name, understate, vg_strdjb2( understate ))){ steam_set_achievement( "CITY_COMPLETE" ); + steam_store_achievements(); } } } } -VG_STATIC int ent_objective_check_filter( ent_objective *objective ){ +static int ent_objective_check_filter( ent_objective *objective ){ if( objective->filter ){ - struct player_skate_state *s = &localplayer._skate.state; + struct player_skate_state *s = &player_skate.state; enum trick_type trick = s->trick_type; u32 state = 0x00; @@ -92,7 +97,7 @@ VG_STATIC int ent_objective_check_filter( ent_objective *objective ){ } } -VG_STATIC void ent_objective_call( world_instance *world, ent_call *call ){ +static void ent_objective_call( world_instance *world, ent_call *call ){ u32 index = mdl_entity_id_id( call->id ); ent_objective *objective = mdl_arritm( &world->ent_objective, index ); @@ -106,8 +111,10 @@ VG_STATIC void ent_objective_call( world_instance *world, ent_call *call ){ ent_objective_pass( world, objective ); } else { + audio_lock(); audio_oneshot_3d( &audio_challenge[6], localplayer.rb.co, 30.0f, 1.0f ); + audio_unlock(); vg_error( "challenge failed\n" ); world_static.challenge_target = NULL; world_static.challenge_timer = 0.0f;