unlock rendering
[carveJwlIkooP6JGAAIwe30JlM.git] / ent_unlock.c
1 #ifndef ENT_UNLOCK_C
2 #define ENT_UNLOCK_C
3
4 #include "entity.h"
5
6 VG_STATIC void ent_unlock_call( world_instance *world, ent_call *call ){
7 u32 index = mdl_entity_id_id( call->id );
8 ent_unlock *unlock = mdl_arritm( &world->ent_unlock, index );
9
10 if( call->function == 0 ){ /* unlock() */
11 if( !unlock->status ){
12 vg_info( "unlock( '%s' )\n",
13 mdl_pstr( &world->meta, unlock->pstr_alias) );
14 ent_call call;
15 call.data = NULL;
16 call.function = unlock->target_event;
17 call.id = unlock->target;
18 entity_call( world, &call );
19 }
20 unlock->status = 1;
21 }
22 else {
23 vg_print_backtrace();
24 vg_error( "Unhandled function id: %u\n", call->function );
25 }
26 }
27
28 #endif /* ENT_UNLOCK_C */