X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fcheats.qc;h=0d95c453a1e6685b1d7032dd06dd520670ae628b;hp=8d837b801453091e65b6443b00ea3a1ed4991721;hb=a8f44b0e98aedacaae872b937ee023e24fc30878;hpb=383e56bd358dfc0e8bc8a43c07d4bdd0f8712e7a diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 8d837b801..0d95c453a 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -14,7 +14,7 @@ void Drag_MoveDrag(entity from, entity to) { } #else .float maycheat; -float sv_cheats; +float gamestart_sv_cheats; #define CHIMPULSE_SPEEDRUN_INIT 30 #define CHIMPULSE_GIVE_ALL 99 @@ -28,7 +28,7 @@ float sv_cheats; void CheatInit() { - sv_cheats = cvar("sv_cheats"); + gamestart_sv_cheats = autocvar_sv_cheats; } void CheatShutdown() @@ -61,7 +61,7 @@ float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as a return 1; // sv_cheats - if(sv_cheats && autocvar_sv_cheats) + if(gamestart_sv_cheats && autocvar_sv_cheats) return 1; // if we get here, player is not allowed to cheat. Log it. @@ -180,10 +180,10 @@ float CheatImpulse(float i) self.health = start_health; self.armorvalue = start_armorvalue; self.weapons |= weaponsInMap; - self.pauserotarmor_finished = time + cvar("g_balance_pause_armor_rot_spawn"); - self.pauserothealth_finished = time + cvar("g_balance_pause_health_rot_spawn"); - self.pauserotfuel_finished = time + cvar("g_balance_pause_fuel_rot_spawn"); - self.pauseregen_finished = time + cvar("g_balance_pause_health_regen_spawn"); + self.pauserotarmor_finished = time + autocvar_g_balance_pause_armor_rot_spawn; + self.pauserothealth_finished = time + autocvar_g_balance_pause_health_rot_spawn; + self.pauserotfuel_finished = time + autocvar_g_balance_pause_fuel_rot_spawn; + self.pauseregen_finished = time + autocvar_g_balance_pause_health_regen_spawn; self.strength_finished = 0; self.invincible_finished = 0; } @@ -215,7 +215,7 @@ float CheatImpulse(float i) break; case CHIMPULSE_TELEPORT: IS_CHEAT(i, 0, 0); - if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, ((sv_cheats >= 2) ? 100000 : 100), 1024, 256)) + if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, ((gamestart_sv_cheats >= 2) ? 100000 : 100), 1024, 256)) { self.angles_x = -self.angles_x; self.fixangle = TRUE; @@ -249,7 +249,7 @@ float CheatImpulse(float i) e2 = spawn(); setorigin(e2, org); pointparticles(particleeffectnum("rocket_explode"), org, '0 0 0', 1); - sound(e2, CHAN_PROJECTILE, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM); + sound(e2, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTN_NORM); RadiusDamage(e2, e, 1000, 0, 128, e, 500, DEATH_CHEAT, world); remove(e2); } @@ -303,7 +303,7 @@ float CheatCommand(float argc) // arguments: // effectname effectnum = particleeffectnum(argv(1)); - W_SetupShot(self, FALSE, FALSE, "",0); + W_SetupShot(self, FALSE, FALSE, "", CH_WEAPON_A, 0); traceline(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, MOVE_NORMAL, self); trailparticles(self, effectnum, w_shotorg, trace_endpos); DID_CHEAT(); @@ -318,7 +318,7 @@ float CheatCommand(float argc) // arguments: // modelname mode f = stof(argv(2)); - W_SetupShot(self, FALSE, FALSE, "", 0); + W_SetupShot(self, FALSE, FALSE, "", CH_WEAPON_A, 0); traceline(w_shotorg, w_shotorg + w_shotdir * 2048, MOVE_NORMAL, self); if((trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) || trace_fraction == 1) { @@ -604,14 +604,6 @@ float CheatCommand(float argc) remove(e); DID_CHEAT(); break; - case "warp": - IS_CHEAT(0, argc, 0); - if(argc == 2) if(cvar("g_campaign")) - { - CampaignLevelWarp(stof(argv(1))); - DID_CHEAT(); - } - break; case "god": IS_CHEAT(0, argc, 0); BITXOR_ASSIGN(self.flags, FL_GODMODE);