#include "network_common.h"
#include "network.h"
-static u32 region_spark_colour( u32 flags ){
+struct global_ent_region global_ent_region;
+
+u32 region_spark_colour( u32 flags )
+{
if( flags & k_ent_route_flag_achieve_gold )
return 0xff8ce0fa;
else if( flags & k_ent_route_flag_achieve_silver )
return 0x00;
}
-static void ent_region_call( world_instance *world, ent_call *call ){
+void ent_region_call( world_instance *world, ent_call *call )
+{
ent_region *region =
mdl_arritm( &world->ent_region, mdl_entity_id_id(call->id) );
/*
* reevaluate all achievements to calculate the compiled achievement
*/
-static void ent_region_re_eval( world_instance *world ){
+void ent_region_re_eval( world_instance *world )
+{
u32 world_total = k_ent_route_flag_achieve_gold |
k_ent_route_flag_achieve_silver;
region->flags = combined;
world_total &= combined;
+
+ /* run unlock triggers. v105+ */
+ if( world->meta.info.version >= 105 ){
+ if( region->flags & (k_ent_route_flag_achieve_gold|
+ k_ent_route_flag_achieve_silver) ){
+ if( region->target0[0] ){
+ ent_call call;
+ call.data = NULL;
+ call.id = region->target0[0];
+ call.function = region->target0[1];
+ entity_call( world, &call );
+ }
+ }
+ }
}
u32 instance_id = world - world_static.instances;