X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_load.c;h=00be6120313c129466a122aa60b8da034ea6d222;hb=5fba3602f053116a8e3849bc12c03198d6d7461c;hp=2ca957a1cca75b13b04761da3e59122b43dc6166;hpb=6190deb68aa1c9e92ede62ea05c2a755bf5516de;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_load.c b/world_load.c index 2ca957a..00be612 100644 --- a/world_load.c +++ b/world_load.c @@ -12,7 +12,7 @@ /* * load the .mdl file located in path as a world instance */ -VG_STATIC void world_instance_load_mdl( u32 instance_id, const char *path ){ +static void world_instance_load_mdl( u32 instance_id, const char *path ){ vg_rand_seed( 9001 ); world_instance *world = &world_static.instances[ instance_id ]; @@ -265,6 +265,11 @@ static void skaterift_change_world_start( addon_reg *reg ){ if( world_static.active_instance != 0 ) vg_error( "Cannot change worlds while in non-root world\n" ); else{ + if( world_static.addon_client == reg ){ + vg_warn( "World is already loaded\n" ); + return; + } + char buf[76]; addon_alias_uid( ®->alias, buf ); vg_info( "switching to: %s\n", buf ); @@ -291,6 +296,8 @@ static void skaterift_change_world_start( addon_reg *reg ){ /* console command for the above function */ static int skaterift_change_world_command( int argc, const char *argv[] ){ + if( !vg_loader_availible() ) return 0; + if( argc == 1 ){ addon_alias q; q.type = k_addon_type_world; @@ -386,7 +393,7 @@ static void world_free( world_instance *world ) * reset the world structure without deallocating persistent buffers * TODO: Make this a memset(0), and have persistent items live in a static loc */ -VG_STATIC void world_init_blank( world_instance *world ) +static void world_init_blank( world_instance *world ) { memset( &world->meta, 0, sizeof(mdl_context) );