X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world.c;h=f8d7168a1ca781a99c60fe1a733d2394035bedff;hb=fbd4abfae41847dcdf4e32ac2c43d79ecaf0f708;hp=def59a36b3edec09d1fe06aa2a9e1a2c4dd34886;hpb=2c91a71533b4ce86b9e7fd708420ae05c74d8f52;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world.c b/world.c index def59a3..f8d7168 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,20 +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 ){ - world_instance *current = - &world_static.instances[ world_static.active_instance ]; v3_copy( localplayer.rb.co, current->player_co ); - v3_copy( localplayer.angles, current->player_angles ); - 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 ); - q_axis_angle( localplayer.rb.q, (v3f){0,1,0}, new->player_angles[3] ); world_static.active_instance = index; - player__reset(); }