X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=ent_region.c;h=fd24f4e1cd3b6f3dc98bfc6b025475b011de76f7;hb=e311bbe2fa903a7e2a922f202f389b799193195d;hp=eecf22d05ff65d1b4846bdb324c56733ed0c2b33;hpb=6d3a4c99f0223a4849e1fd2beab937d496800e2c;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/ent_region.c b/ent_region.c index eecf22d..fd24f4e 100644 --- a/ent_region.c +++ b/ent_region.c @@ -62,6 +62,9 @@ static void ent_region_call( world_instance *world, ent_call *call ){ * reevaluate all achievements to calculate the compiled achievement */ static void ent_region_re_eval( world_instance *world ){ + u32 world_total = k_ent_route_flag_achieve_gold | + k_ent_route_flag_achieve_silver; + for( u32 i=0; ient_region); i ++ ){ ent_region *region = mdl_arritm(&world->ent_region, i); @@ -109,5 +112,25 @@ static void ent_region_re_eval( world_instance *world ){ } region->flags = combined; + world_total &= combined; + } + + u32 instance_id = world - world_static.instances; + + if( world_static.instance_addons[instance_id]->flags & ADDON_REG_MTZERO ){ + if( world_total & k_ent_route_flag_achieve_gold ){ + steam_set_achievement( "MTZERO_GOLD" ); + steam_store_achievements(); + } + + if( world_total & k_ent_route_flag_achieve_silver ){ + steam_set_achievement( "MTZERO_SILVER" ); + steam_store_achievements(); + } + } + + if( world_static.instance_addons[instance_id]->flags & ADDON_REG_CITY ){ + steam_set_achievement( "CITY_COMPLETE" ); + steam_store_achievements(); } }