- if( type == k_ent_volume ){
- ent_volume_call( world, call );
- } else if( type == k_ent_audio ){
- ent_audio_call( world, call );
- } else if( type == k_ent_skateshop ){
- ent_skateshop_call( world, call );
+ fn_entity_call_handler table[] = {
+ [k_ent_volume] = ent_volume_call,
+ [k_ent_audio] = ent_audio_call,
+ [k_ent_skateshop] = ent_skateshop_call,
+ [k_ent_objective] = ent_objective_call,
+ [k_ent_ccmd] = ent_ccmd_call,
+ [k_ent_gate] = ent_gate_call,
+ [k_ent_relay] = ent_relay_call,
+ [k_ent_challenge] = ent_challenge_call,
+ [k_ent_route] = ent_route_call,
+ [k_ent_miniworld] = ent_miniworld_call,
+ [k_ent_region] = ent_region_call
+ };
+
+ if( type >= vg_list_size(table) ){
+ vg_error( "call to entity type: %u is out of range\n", type );
+ return;