X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_render.c;h=281a6e7a69cb8f75857d4ac16f49aa5a4ba8ff8a;hb=6e96ba64e805ea8a39ca46171e28426c6bc86ab6;hp=1546429235fe10b36e8643aa2132417a306dcc94;hpb=70ff4a83e5a4b35436388d9bb999c939559ac23f;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_render.c b/world_render.c index 1546429..281a6e7 100644 --- a/world_render.c +++ b/world_render.c @@ -763,10 +763,6 @@ static void render_world_gates( world_instance *world, camera *cam ){ for( u32 i=0; ient_gate); i++ ){ ent_gate *gi = mdl_arritm( &world->ent_gate, i ); - if( !(gi->flags & (k_ent_gate_linked|k_ent_gate_nonlocal_DELETED| - k_ent_gate_locked)) ) - continue; - float dist = v3_dist2( gi->co[0], cam->transform[3] ); vg_line_point( gi->co[0], 0.25f, VG__BLUE ); @@ -778,8 +774,25 @@ static void render_world_gates( world_instance *world, camera *cam ){ } world->rendering_gate = gate; - if( gate ) - render_gate( world, world, gate, cam ); + + if( gate ){ + if( gate->flags & k_ent_gate_locked ){ + world->rendering_gate = NULL; + return; + } + + if( gate->flags & k_ent_gate_nonlocal ){ + if( world_static.load_state != k_world_loader_none ){ + world->rendering_gate = NULL; + return; + } + + world_instance *dest_world = &world_static.instances[ gate->target ]; + render_gate( world, dest_world, gate, cam ); + } + else + render_gate( world, world, gate, cam ); + } } static void world_prerender( world_instance *world ){