network items, interp boundaries
[carveJwlIkooP6JGAAIwe30JlM.git] / world_gate.c
index b236bc9bd1f3934c2a180edc44099f73dc3c79bd..bb62e341aab99085071a9edc55d08ba6da73fc57 100644 (file)
@@ -16,6 +16,7 @@
 #include "camera.h"
 
 #include "world_water.h"
+#include "player_remote.h"
 
 /*
  * Update the transform matrices for gate
@@ -196,6 +197,7 @@ static int render_gate( world_instance *world, world_instance *world_inside,
       glDisable( GL_STENCIL_TEST );
    }
 
+   render_remote_players( world_inside, &world_gates.cam );
    return 1;
 }
 
@@ -247,8 +249,7 @@ static int gate_intersect_plane( ent_gate *gate,
 /*
  * Intersect specific gate
  */
-static int gate_intersect( ent_gate *gate, v3f pos, v3f last )
-{
+static int gate_intersect( ent_gate *gate, v3f pos, v3f last ){
    v2f xy;
 
    if( gate_intersect_plane( gate, pos, last, xy ) ){
@@ -264,26 +265,22 @@ static int gate_intersect( ent_gate *gate, v3f pos, v3f last )
 /* 
  * Intersect all gates in the world
  */
-static ent_gate *world_intersect_gates( world_instance *world,
-                                           v3f pos, v3f last ){
+static u32 world_intersect_gates( world_instance *world, v3f pos, v3f last ){
    for( u32 i=0; i<mdl_arrcount(&world->ent_gate); i++ ){
       ent_gate *gate = mdl_arritm( &world->ent_gate, i );
 
       if( !(gate->flags & k_ent_gate_linked) ) continue;
       if( gate->flags & k_ent_gate_locked ) continue;
 
-      if( gate->flags & k_ent_gate_nonlocal ){
-         if( world_static.load_state != k_world_loader_none ){
+      if( gate->flags & k_ent_gate_nonlocal )
+         if( world_static.load_state != k_world_loader_none )
             continue;
-         }
-      }
 
-      if( gate_intersect( gate, pos, last ) ){
-         return gate;
-      }
+      if( gate_intersect( gate, pos, last ) )
+         return mdl_entity_id( k_ent_gate, i );
    }
 
-   return NULL;
+   return 0;
 }
 
 /*