X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fmutators%2Fmutator%2Fgamemode_cts.qc;h=f12d5f75f023d15b67460740ccc71216f9a4a7b7;hb=12ad79a6e66bd40fb5afea8618a4c8960892b129;hp=daec722f4f62e1dd9eab1871bd5fa8459300029b;hpb=30e724fe1e818fa1a1e57250f260f7141f1f379b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/mutators/mutator/gamemode_cts.qc b/qcsrc/server/mutators/mutator/gamemode_cts.qc index daec722f4..f12d5f75f 100644 --- a/qcsrc/server/mutators/mutator/gamemode_cts.qc +++ b/qcsrc/server/mutators/mutator/gamemode_cts.qc @@ -98,8 +98,8 @@ MUTATOR_HOOKFUNCTION(cts, PlayerPhysics) // ensure nothing EVIL is being done (i.e. div0_evade) // this hinders joystick users though // but it still gives SOME analog control - wishvel.x = fabs(player.movement.x); - wishvel.y = fabs(player.movement.y); + wishvel.x = fabs(CS(player).movement.x); + wishvel.y = fabs(CS(player).movement.y); if(wishvel.x != 0 && wishvel.y != 0 && wishvel.x != wishvel.y) { wishvel.z = 0; @@ -107,32 +107,32 @@ MUTATOR_HOOKFUNCTION(cts, PlayerPhysics) if(wishvel.x >= 2 * wishvel.y) { // pure X motion - if(player.movement.x > 0) - player.movement_x = wishspeed; + if(CS(player).movement.x > 0) + CS(player).movement_x = wishspeed; else - player.movement_x = -wishspeed; - player.movement_y = 0; + CS(player).movement_x = -wishspeed; + CS(player).movement_y = 0; } else if(wishvel.y >= 2 * wishvel.x) { // pure Y motion - player.movement_x = 0; - if(player.movement.y > 0) - player.movement_y = wishspeed; + CS(player).movement_x = 0; + if(CS(player).movement.y > 0) + CS(player).movement_y = wishspeed; else - player.movement_y = -wishspeed; + CS(player).movement_y = -wishspeed; } else { // diagonal - if(player.movement.x > 0) - player.movement_x = M_SQRT1_2 * wishspeed; + if(CS(player).movement.x > 0) + CS(player).movement_x = M_SQRT1_2 * wishspeed; else - player.movement_x = -M_SQRT1_2 * wishspeed; - if(player.movement.y > 0) - player.movement_y = M_SQRT1_2 * wishspeed; + CS(player).movement_x = -M_SQRT1_2 * wishspeed; + if(CS(player).movement.y > 0) + CS(player).movement_y = M_SQRT1_2 * wishspeed; else - player.movement_y = -M_SQRT1_2 * wishspeed; + CS(player).movement_y = -M_SQRT1_2 * wishspeed; } } } @@ -238,7 +238,7 @@ MUTATOR_HOOKFUNCTION(cts, PutClientInServer) if(IS_PLAYER(player)) if(!game_stopped) { - if(player.killcount == FRAGS_SPECTATOR /* initial spawn */ || g_race_qualifying) // spawn + if(CS(player).killcount == FRAGS_SPECTATOR /* initial spawn */ || g_race_qualifying) // spawn race_PreparePlayer(player); else // respawn race_RetractPlayer(player); @@ -267,7 +267,7 @@ MUTATOR_HOOKFUNCTION(cts, GetPressedKeys) { entity player = M_ARGV(0, entity); - if(player.cvar_cl_allow_uidtracking == 1 && player.cvar_cl_allow_uid2name == 1) + if(CS(player).cvar_cl_allow_uidtracking == 1 && CS(player).cvar_cl_allow_uid2name == 1) { if (!player.stored_netname) player.stored_netname = strzone(uid2name(player.crypto_idfp)); @@ -387,6 +387,11 @@ MUTATOR_HOOKFUNCTION(cts, Race_FinalCheckpoint) CTS_ClientKill(player); } +MUTATOR_HOOKFUNCTION(cts, HideTeamNagger) +{ + return true; // doesn't work so well (but isn't cts a teamless mode?) +} + MUTATOR_HOOKFUNCTION(cts, FixClientCvars) { entity player = M_ARGV(0, entity); @@ -401,6 +406,11 @@ MUTATOR_HOOKFUNCTION(cts, WantWeapon) return true; } +MUTATOR_HOOKFUNCTION(cts, ForbidDropCurrentWeapon) +{ + return true; +} + void cts_Initialize() { cts_ScoreRules();