X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=ent_challenge.c;h=861edbd6f60e10f9bac4b8ed9c12e093c9fee37a;hb=be5e25dee2c54c2a22ca3bbb5bbe0eb6149343be;hp=9499d0fed8e7b0e6ce9f51fcd1cf0a161d373c55;hpb=f01a25e33a54c92e4d6bca0889b76f33af5e51eb;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/ent_challenge.c b/ent_challenge.c index 9499d0f..861edbd 100644 --- a/ent_challenge.c +++ b/ent_challenge.c @@ -46,15 +46,18 @@ entity_call_result ent_challenge_call( world_instance *world, ent_call *call ) return k_entity_call_result_unhandled; } -void ent_challenge_preupdate( ent_challenge *challenge, int active ) +void ent_challenge_preupdate( ent_focus_context *ctx ) { - world_instance *world = world_current_instance(); + world_instance *world = ctx->world; + ent_challenge *challenge = mdl_arritm( &world->ent_challenge, ctx->index ); /* maximum distance from active challenge */ - if( !active ){ + if( !ctx->active ) + { f32 min_dist2 = 999999.9f; - if( mdl_entity_id_type( challenge->first ) == k_ent_objective ){ + if( mdl_entity_id_type( challenge->first ) == k_ent_objective ) + { u32 next = challenge->first; while( mdl_entity_id_type(next) == k_ent_objective ){ u32 index = mdl_entity_id_id( next );