X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fgamemodes%2Fgamemode%2Frace%2Fsv_race.qc;h=c87384c94bc3377c45f27fa6d7ac422585c6657f;hb=cd9380e44806612f8eb2d04f27ca283ae8f0a461;hp=39c72a4593a9878fbe755f1211c977ff8ffd83cb;hpb=6c4bdd5eeea06db69a457997de24bef84b4eaf93;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/gamemodes/gamemode/race/sv_race.qc b/qcsrc/common/gamemodes/gamemode/race/sv_race.qc index 39c72a459..c87384c94 100644 --- a/qcsrc/common/gamemodes/gamemode/race/sv_race.qc +++ b/qcsrc/common/gamemodes/gamemode/race/sv_race.qc @@ -128,16 +128,26 @@ MUTATOR_HOOKFUNCTION(rc, AbortSpeedrun) race_PreparePlayer(player); // nice try } -MUTATOR_HOOKFUNCTION(rc, PlayerPhysics) +MUTATOR_HOOKFUNCTION(rc, PlayerPreThink) { entity player = M_ARGV(0, entity); - float dt = M_ARGV(1, float); + if(!IS_PLAYER(player)) + return; + + // we need to perform this in PlayerPreThink as PlayerPhysics may not be called (vehicle support) + float dt = frametime; player.race_movetime_frac += dt; float f = floor(player.race_movetime_frac); player.race_movetime_frac -= f; player.race_movetime_count += f; player.race_movetime = player.race_movetime_frac + player.race_movetime_count; +} + +MUTATOR_HOOKFUNCTION(rc, PlayerPhysics) +{ + entity player = M_ARGV(0, entity); + //float dt = M_ARGV(1, float); #ifdef SVQC if(IS_PLAYER(player)) @@ -208,7 +218,7 @@ MUTATOR_HOOKFUNCTION(rc, reset_map_global) Score_NicePrint(NULL); race_ClearRecords(); - PlayerScore_Sort(race_place, 0, 1, 0); + PlayerScore_Sort(race_place, 0, true, false); FOREACH_CLIENT(true, { if(it.race_place) @@ -328,7 +338,7 @@ MUTATOR_HOOKFUNCTION(rc, GetPressedKeys) { entity player = M_ARGV(0, entity); - if(CS(player).cvar_cl_allow_uidtracking == 1 && CS(player).cvar_cl_allow_uid2name == 1) + if(CS_CVAR(player).cvar_cl_allow_uidtracking == 1 && CS_CVAR(player).cvar_cl_allow_uid2name == 1) { if (!player.stored_netname) player.stored_netname = strzone(uid2name(player.crypto_idfp));