revision 2
[carveJwlIkooP6JGAAIwe30JlM.git] / entity.c
index ce6d98eb76ecd959f572160c8f6c08f14b66d928..261dbbcd2c1ba89c89b58d4ff45997eae0f2871a 100644 (file)
--- a/entity.c
+++ b/entity.c
@@ -1,23 +1,20 @@
-#ifndef ENTITY_C
-#define ENTITY_C
-
 #include "world.h"
 #include "entity.h"
 #include "world_entity.h"
 
-#include "ent_skateshop.c"
-#include "ent_objective.c"
-#include "ent_challenge.c"
-#include "ent_relay.c"
-#include "ent_route.c"
-#include "ent_miniworld.c"
-#include "ent_region.c"
-#include "ent_traffic.c"
-#include "ent_glider.c"
+#include "ent_objective.h"
+#include "ent_skateshop.h"
+#include "ent_relay.h"
+#include "ent_challenge.h"
+#include "ent_route.h"
+#include "ent_miniworld.h"
+#include "ent_region.h"
+#include "ent_glider.h"
 
 typedef void (*fn_entity_call_handler)( world_instance *, ent_call *);
 
-static void entity_call( world_instance *world, ent_call *call ){
+void entity_call( world_instance *world, ent_call *call )
+{
    u32 type = mdl_entity_id_type( call->id );
 
    fn_entity_call_handler table[] = {
@@ -50,4 +47,17 @@ static void entity_call( world_instance *world, ent_call *call ){
    fn( world, call );
 }
 
-#endif /* ENTITY_C */
+ent_marker *ent_find_marker( mdl_context *mdl, mdl_array_ptr *arr, 
+                             const char *alias )
+{
+   for( u32 i=0; i<mdl_arrcount(arr); i++ ){
+      ent_marker *marker = mdl_arritm( arr, i );
+
+      if( !strcmp( mdl_pstr( mdl, marker->pstr_alias ), alias ) ){
+         return marker;
+      }
+   }
+
+   return NULL;
+}
+