plish
[carveJwlIkooP6JGAAIwe30JlM.git] / world_gate.h
index f83cd87a24dd0455a8fea06bf667ba571c896921..1bf8afef0c4584d294bbe044780fbbd4485759d3 100644 (file)
@@ -211,4 +211,21 @@ VG_STATIC int gate_intersect( teleport_gate *gate, v3f pos, v3f last )
    return 0;
 }
 
+/* 
+ * Intersect all gates in the world
+ */
+VG_STATIC teleport_gate *world_intersect_gates( v3f pos, v3f last )
+{
+   for( int i=0; i<world.gate_count; i++ )
+   {
+      struct route_gate *rg = &world.gates[i];
+      teleport_gate *gate = &rg->gate;
+
+      if( gate_intersect( gate, pos, last ) )
+         return gate;
+   }
+
+   return NULL;
+}
+
 #endif /* WORLD_GATE_H */