X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=ent_objective.c;h=d516e2756895d0c045d92c5b1730d28c72516f25;hb=53597f45307d8a2120e3a0bbe71797b216e8750b;hp=c037eaf5cbb5cb5afe1d55527a5c4c59317cc341;hpb=bd3a7e904be0fc97e70761cc957a28609d366586;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/ent_objective.c b/ent_objective.c index c037eaf..d516e27 100644 --- a/ent_objective.c +++ b/ent_objective.c @@ -5,6 +5,7 @@ #include "world_load.h" #include "entity.h" #include "audio.h" +#include "steam.h" VG_STATIC void ent_objective_pass( world_instance *world, ent_objective *objective ){ @@ -29,6 +30,7 @@ VG_STATIC void ent_objective_pass( world_instance *world, audio_oneshot( &audio_challenge[2], 1.0f, 0.0f ); world_static.challenge_target = NULL; world_static.challenge_timer = 0.0f; + world_static.focused_entity = 0; if( objective->id_win ){ ent_call call; @@ -37,6 +39,24 @@ VG_STATIC void ent_objective_pass( world_instance *world, call.id = objective->id_win; entity_call( world, &call ); } + + u32 world_completed = 1; + for( u32 i=0; ient_challenge); i++ ){ + ent_challenge *challenge = mdl_arritm( &world->ent_challenge, i ); + if( !challenge->status ){ + world_completed = 0; + break; + } + } + + if( world_completed ){ + const char *understate = "Understate DIY park"; + if( mdl_pstreq( &world->meta, world->info.pstr_name, + understate, vg_strdjb2( understate ))){ + steam_set_achievement( "CITY_COMPLETE" ); + steam_store_achievements(); + } + } } }