X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Frace.qc;h=c2de3c9cc63e830a1859f7a16989a3e66d08c55e;hb=77a72b8a1d5686ac0ee30d5019f512086bcbaf3e;hp=183da23f9a6944ce0c5424ee1e17ff94086c5edf;hpb=eaf526ab1006ff1439082ecc7b73795cd9de9027;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index 183da23f9..c2de3c9cc 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -1,8 +1,13 @@ #include "race.qh" -#include +#include +#include +#include +#include #include +#include #include "client.qh" +#include "cheats.qh" #include "portals.qh" #include "scores.qh" #include "spawnpoints.qh" @@ -10,18 +15,25 @@ #include "command/getreplies.qh" #include "../common/deathtypes/all.qh" #include "../common/notifications/all.qh" -#include "../common/mapinfo.qh" +#include #include #include #include +#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() { @@ -30,8 +42,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)); @@ -85,8 +95,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)); + } } } @@ -105,8 +118,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; @@ -566,6 +577,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! @@ -758,7 +772,7 @@ void trigger_race_checkpoint_verify(entity this) // race only (middle of the race) g_race_qualifying = false; pl_race_place = 0; - if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false)) { + if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false, true)) { error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(pl_race_place), " (used for respawning in race) - bailing out")); } @@ -766,7 +780,7 @@ void trigger_race_checkpoint_verify(entity this) // qualifying only g_race_qualifying = 1; pl_race_place = race_lowest_place_spawn; - if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false)) { + if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false, true)) { error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(pl_race_place), " (used for qualifying) - bailing out")); } @@ -774,7 +788,7 @@ void trigger_race_checkpoint_verify(entity this) g_race_qualifying = 0; for (int p = 1; p <= race_highest_place_spawn; ++p) { pl_race_place = p; - if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false)) { + if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false, true)) { error(strcat("Checkpoint ", ftos(i), " misses a spawnpoint with race_place==", ftos(pl_race_place), " (used for initially spawning in race) - bailing out")); } } @@ -785,7 +799,7 @@ void trigger_race_checkpoint_verify(entity this) pl_race_checkpoint = race_NextCheckpoint(0); g_race_qualifying = 1; pl_race_place = race_lowest_place_spawn; - if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false)) { + if (!Spawn_FilterOutBadSpots(this, findchain(classname, "info_player_deathmatch"), 0, false, true)) { error(strcat("Checkpoint 0 misses a spawnpoint with race_place==", ftos(pl_race_place), " (used for qualifying) - bailing out")); } } else {