completed all glider stuff
[carveJwlIkooP6JGAAIwe30JlM.git] / ent_glider.c
diff --git a/ent_glider.c b/ent_glider.c
new file mode 100644 (file)
index 0000000..d1e2a36
--- /dev/null
@@ -0,0 +1,21 @@
+#pragma once
+#include "entity.h"
+#include "player_glide.h"
+
+static void ent_glider_call( world_instance *world, ent_call *call ){
+   u32 index = mdl_entity_id_id( call->id );
+   ent_glider *glider = mdl_arritm( &world->ent_glider, index );
+
+   if( call->function == 0 ){
+      glider->flags |= 0x1;
+   }
+   else if( call->function == 1 ){
+      if( glider->flags & 0x1 ){
+         player_glide_equip_glider();
+      }
+   }
+   else {
+      vg_print_backtrace();
+      vg_error( "Unhandled function id: %i\n", call->function );
+   }
+}