X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_gate.h;h=1bf8afef0c4584d294bbe044780fbbd4485759d3;hb=76042e561d89b232f04cac8a431b5cd7b30a6b9d;hp=f83cd87a24dd0455a8fea06bf667ba571c896921;hpb=9edcce70acf6cf8fbb2449bf54d797e212ebb2c2;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_gate.h b/world_gate.h index f83cd87..1bf8afe 100644 --- a/world_gate.h +++ b/world_gate.h @@ -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; igate; + + if( gate_intersect( gate, pos, last ) ) + return gate; + } + + return NULL; +} + #endif /* WORLD_GATE_H */