X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world.c;h=5a97d944b5f0bb6c79899765a636bab0398b450e;hb=6e6c7f31b8f17af3814727109e48fc6f85ef04b1;hp=ad0372389a54eaff63cdbdb0011098a1877c2915;hpb=7f4c71033c06954f3094c9d51219628438b80ac8;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world.c b/world.c index ad03723..5a97d94 100644 --- a/world.c +++ b/world.c @@ -27,7 +27,7 @@ static void world_init(void) } static void world_switch_instance( u32 index ){ - assert( localplayer.subsystem == k_player_subsystem_walk ); + localplayer.subsystem = k_player_subsystem_walk; if( index >= vg_list_size(world_static.instances) ){ vg_error( "Instance ID out of range (%u)\n", index ); @@ -41,35 +41,24 @@ static void world_switch_instance( u32 index ){ return; } + if( skaterift.demo_mode ){ + if( world_static.instance_addons[index]->flags & ADDON_REG_PREMIUM ){ + vg_error( "Can't switch to a premium world in the demo version\n" ); + return; + } + } + world_instance *current = &world_static.instances[ world_static.active_instance ]; if( index != world_static.active_instance ){ v3_copy( localplayer.rb.co, current->player_co ); - v3_copy( localplayer.angles, current->player_angles ); - v3_copy( localplayer.cam.pos, current->cam_co ); - current->player_angles[3] = player_get_heading_yaw(); + skaterift_autosave(1); } v3_copy( new->player_co, localplayer.rb.co ); - v3_copy( new->player_angles, localplayer.angles ); - v3_copy( new->cam_co, localplayer.cam.pos ); - q_axis_angle( localplayer.rb.q, (v3f){0,1,0}, new->player_angles[3] ); - - /* run exit events on triggers */ - for( u32 i=0; ient_volume, idx ); - - ent_call basecall; - basecall.function = k_ent_function_trigger_leave; - basecall.id = mdl_entity_id( k_ent_volume, idx ); - basecall.data = NULL; - entity_call( current, &basecall ); - } world_static.active_instance = index; - player__reset(); } @@ -102,7 +91,6 @@ static void skaterift_world_get_save_path( enum world_purpose which, #include "world_water.c" #include "world_audio.c" #include "world_routes.c" -#include "world_traffic.c" static void world_update( world_instance *world, v3f pos ){ world_render.sky_time += world_render.sky_rate * vg.time_delta; @@ -112,7 +100,7 @@ static void world_update( world_instance *world, v3f pos ){ world_routes_update_timer_texts( world ); world_routes_update( world ); - world_traffic_update( world, pos ); + ent_traffic_update( world, pos ); world_sfd_update( world, pos ); world_volumes_update( world, pos ); }