X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Frace.qc;h=9a12a04866c2c251fdd333725f0a22c4af757fff;hp=da86f76f0bf4dbcd1deceb6027bfd96c58eda2dd;hb=3ac61b98c83be079c61cf525491d2028b2a889dc;hpb=7530a8fe25423d8545e3622c8e36b4f82090b55d diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index da86f76f0..9a12a0486 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -14,13 +14,21 @@ #include #include #include -#include "../common/triggers/subs.qh" +#include +#include "../common/mapobjects/subs.qh" +#include #include "../lib/warpzone/util_server.qh" #include "../lib/warpzone/common.qh" +#include #include "../common/mutators/mutator/waypoints/waypointsprites.qh" IntrusiveList g_race_targets; -STATIC_INIT(g_race_targets) { g_race_targets = IL_NEW(); } +IntrusiveList g_racecheckpoints; +STATIC_INIT(g_race) +{ + g_race_targets = IL_NEW(); + g_racecheckpoints = IL_NEW(); +} void race_InitSpectator() { @@ -29,8 +37,6 @@ void race_InitSpectator() race_SendNextCheckpoint(msg_entity.enemy, 1); } -void W_Porto_Fail(entity this, float failhard); - float race_readTime(string map, float pos) { string rr = ((g_cts) ? CTS_RECORD : ((g_ctf) ? CTF_RECORD : RACE_RECORD)); @@ -84,8 +90,11 @@ void race_writeTime(string map, float t, string myuid) // player has no ranked record yet for (i = RANKINGS_CNT; i > newpos; --i) { - db_put(ServerProgsDB, strcat(map, rr, "time", ftos(i)), ftos(race_readTime(map, i - 1))); - db_put(ServerProgsDB, strcat(map, rr, "crypto_idfp", ftos(i)), race_readUID(map, i - 1)); + float other_time = race_readTime(map, i - 1); + if (other_time) { + db_put(ServerProgsDB, strcat(map, rr, "time", ftos(i)), ftos(other_time)); + db_put(ServerProgsDB, strcat(map, rr, "crypto_idfp", ftos(i)), race_readUID(map, i - 1)); + } } } @@ -104,8 +113,6 @@ string race_readName(string map, float pos) const float MAX_CHECKPOINTS = 255; -spawnfunc(target_checkpoint); - .float race_penalty; .float race_penalty_accumulator; .string race_penalty_reason; @@ -565,6 +572,9 @@ void race_ClearTime(entity e) void checkpoint_passed(entity this, entity player) { + if(IS_VEHICLE(player) && player.owner) + player = player.owner; + if(player.personal && autocvar_g_allow_checkpoints) return; // practice mode!