X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_routes.c;h=f4de14c9786792985958bbea4a8d45f59f3011c3;hb=d27f8a570e5cfad1974b4be303888e17ff846406;hp=52c2c2aa76ad4afad3d10211fcca13afb1e99c5b;hpb=1d8d9366022c064ef56d80d463c90a79721c6243;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_routes.c b/world_routes.c index 52c2c2a..f4de14c 100644 --- a/world_routes.c +++ b/world_routes.c @@ -23,38 +23,6 @@ #include "shaders/scene_route.h" #include "shaders/routeui.h" -#if 0 -static -void world_routes_local_set_record( world_instance *world, ent_route *route, - f64 lap_time ) -{ - vg_success( " NEW LAP TIME: %f\n", lap_time ); - - if( route->anon.official_track_id != 0xffffffff ){ - double time_centiseconds = lap_time * 100.0; - if( time_centiseconds > (float)0xfffe ) /* skill issue */ - return; - - struct track_info *ti = &track_infos[ route->anon.official_track_id ]; - highscore_record *record = &ti->record; - record->trackid = route->anon.official_track_id; - record->datetime = time(NULL); - record->playerid = 0; - record->points = 0; - record->time = time_centiseconds; - ti->push = 1; - - if( ti->achievement_id ){ - steam_set_achievement( ti->achievement_id ); - steam_store_achievements(); - } - } - else{ - vg_warn( "There is no associated track for this record...\n" ); - } -} -#endif - static void world_routes_clear( world_instance *world ) { for( u32 i=0; ient_route ); i++ ){ @@ -870,7 +838,6 @@ static void world_gen_routes_generate( u32 instance_id ){ if( instance_id <= 1 /*world_loader.generate_point_cloud*/ ){ f64 area = 0.0; -#if VG_RELEASE area = world_routes_scatter_surface_points( world, pcbuf, 16.0f ); world_routes_surface_grid( world, pcbuf ); @@ -881,7 +848,6 @@ static void world_gen_routes_generate( u32 instance_id ){ 2.0f, 50.0f, 128, (v4f){0.2f,0.2f,0.2f,1.0f} ); } -#endif vg_info( "Distributed %u points over %fkm^2!\n", pcbuf->count, area/1e6f ); @@ -966,12 +932,14 @@ static void world_routes_recv_scoreboard( world_instance *world, struct leaderboard_cache *board = &world->leaderboard_cache[ route_id ]; board->status = status; - if( body == NULL ) + if( body == NULL ){ board->data_len = 0; + return; + } - if( body->max > NETWORK_LEADERBOARD_MAX_SIZE ){ + if( body->max > NETWORK_REQUEST_MAX ){ vg_error( "Scoreboard leaderboard too big (%u>%u)\n", body->max, - NETWORK_LEADERBOARD_MAX_SIZE ); + NETWORK_REQUEST_MAX ); return; }