X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=ent_unlock.c;fp=ent_unlock.c;h=8a266ae448f24b96fdff5fae22fbb6e820781afe;hb=44459e0aa734b6a090d60a309e29a9a2a232c731;hp=0000000000000000000000000000000000000000;hpb=6ab4435fb19beb6af6c52691793d5ca17a120f69;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/ent_unlock.c b/ent_unlock.c new file mode 100644 index 0000000..8a266ae --- /dev/null +++ b/ent_unlock.c @@ -0,0 +1,28 @@ +#ifndef ENT_UNLOCK_C +#define ENT_UNLOCK_C + +#include "entity.h" + +VG_STATIC void ent_unlock_call( world_instance *world, ent_call *call ){ + u32 index = mdl_entity_id_id( call->id ); + ent_unlock *unlock = mdl_arritm( &world->ent_unlock, index ); + + if( call->function == 0 ){ /* unlock() */ + if( !unlock->status ){ + vg_info( "unlock( '%s' )\n", + mdl_pstr( &world->meta, unlock->pstr_alias) ); + ent_call call; + call.data = NULL; + call.function = unlock->target_event; + call.id = unlock->target; + entity_call( world, &call ); + } + unlock->status = 1; + } + else { + vg_print_backtrace(); + vg_error( "Unhandled function id: %u\n", call->function ); + } +} + +#endif /* ENT_UNLOCK_C */