X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fcheats.qc;h=631f382278becf7486a0b5dd9d47d905d0e7f10d;hp=a7cbeae2856f37e6ffd7913524810e58c94e76f1;hb=d492869ab1f18e05121529b7bcffcb637d13994c;hpb=2300937585fd409c578a516ed5e051ba389646d4 diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index a7cbeae28..631f38227 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -4,7 +4,7 @@ #include "race.qh" #include "../common/triggers/teleporters.qh" -#include "mutators/all.qh" +#include "mutators/_mod.qh" #include "weapons/tracing.qh" @@ -14,9 +14,9 @@ #include -#include "../common/monsters/all.qh" +#include "../common/monsters/_mod.qh" -#include "../common/weapons/all.qh" +#include #include "../common/triggers/subs.qh" @@ -164,7 +164,7 @@ float CheatImpulse(entity this, int imp) this.personal.strength_finished = this.strength_finished; this.personal.invincible_finished = this.invincible_finished; this.personal.teleport_time = time; - break; // this part itthis doesn't cheat, so let's not count this + break; // this part itself doesn't cheat, so let's not count this case CHIMPULSE_CLONE_MOVING.impulse: IS_CHEAT(this, imp, 0, 0); makevectors (this.v_angle); @@ -232,7 +232,7 @@ float CheatImpulse(entity this, int imp) break; case CHIMPULSE_TELEPORT.impulse: IS_CHEAT(this, imp, 0, 0); - if(this.movetype == MOVETYPE_NOCLIP) + if(this.move_movetype == MOVETYPE_NOCLIP) { e = find(NULL, classname, "info_autoscreenshot"); if(e) @@ -240,7 +240,7 @@ float CheatImpulse(entity this, int imp) sprint(this, "Emergency teleport used info_autoscreenshot location\n"); setorigin(this, e.origin); this.angles = e.angles; - remove(e); + delete(e); // should we? this.angles_x = -this.angles_x; this.fixangle = true; this.velocity = '0 0 0'; @@ -262,7 +262,7 @@ float CheatImpulse(entity this, int imp) case CHIMPULSE_R00T.impulse: IS_CHEAT(this, imp, 0, 0); RandomSelection_Init(); - FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it) && DIFF_TEAM(it, this), LAMBDA(RandomSelection_Add(it, 0, string_null, 1, 1))); + FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it) && DIFF_TEAM(it, this), LAMBDA(RandomSelection_AddEnt(it, 1, 1))); if(RandomSelection_chosen_ent) e = RandomSelection_chosen_ent; else @@ -274,7 +274,7 @@ float CheatImpulse(entity this, int imp) e2 = spawn(); setorigin(e2, e.origin); RadiusDamage(e2, this, 1000, 0, 128, NULL, NULL, 500, DEATH_CHEAT.m_id, e); - remove(e2); + delete(e2); LOG_INFO("404 Sportsmanship not found.\n"); DID_CHEAT(); @@ -323,8 +323,8 @@ float CheatCommand(entity this, int argc) // arguments: // effectname effectnum = _particleeffectnum(argv(1)); - W_SetupShot(this, false, false, SND_Null, CH_WEAPON_A, 0); - traceline(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, MOVE_NORMAL, this); + W_SetupShot(this, weaponentities[0], false, false, SND_Null, CH_WEAPON_A, 0); + traceline(w_shotorg, w_shotorg + w_shotdir * max_shot_distance, MOVE_NORMAL, this); __trailparticles(this, effectnum, w_shotorg, trace_endpos); DID_CHEAT(); break; @@ -338,7 +338,7 @@ float CheatCommand(entity this, int argc) // arguments: // modelname mode f = stof(argv(2)); - W_SetupShot(this, false, false, SND_Null, CH_WEAPON_A, 0); + W_SetupShot(this, weaponentities[0], false, false, SND_Null, CH_WEAPON_A, 0); traceline(w_shotorg, w_shotorg + w_shotdir * 2048, MOVE_NORMAL, this); if((trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) || trace_fraction == 1) { @@ -364,7 +364,7 @@ float CheatCommand(entity this, int argc) tracebox(e.origin, e.mins, e.maxs, e.origin, MOVE_NORMAL, e); if(trace_startsolid) { - remove(e); + delete(e); sprint(this, "cannot make stuff there (no space)\n"); } else @@ -444,7 +444,7 @@ float CheatCommand(entity this, int argc) e.nextthink = time; e.solid = 0; // nothing special setmodel(e, MDL_MARKER); - setsize(e, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL)); + setsize(e, STAT(PL_MIN, this), STAT(PL_MAX, this)); e.skin = 2; if(argc == 3) e.cnt = stof(argv(1)); @@ -475,18 +475,18 @@ float CheatCommand(entity this, int argc) RandomSelection_Init(); crosshair_trace(this); for(entity e = NULL; (e = find(e, classname, "dragbox_box")); ) - RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); + RandomSelection_AddEnt(e, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); for(entity e = NULL; (e = find(e, classname, "dragpoint")); ) - RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); + RandomSelection_AddEnt(e, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); if(RandomSelection_chosen_ent) { - remove(RandomSelection_chosen_ent.killindicator.killindicator); - remove(RandomSelection_chosen_ent.killindicator); + delete(RandomSelection_chosen_ent.killindicator.killindicator); + delete(RandomSelection_chosen_ent.killindicator); if(RandomSelection_chosen_ent.aiment) - remove(RandomSelection_chosen_ent.aiment); + delete(RandomSelection_chosen_ent.aiment); if(RandomSelection_chosen_ent.enemy) - remove(RandomSelection_chosen_ent.enemy); - remove(RandomSelection_chosen_ent); + delete(RandomSelection_chosen_ent.enemy); + delete(RandomSelection_chosen_ent); } DID_CHEAT(); break; @@ -497,9 +497,9 @@ float CheatCommand(entity this, int argc) RandomSelection_Init(); crosshair_trace(this); for(entity e = NULL; (e = find(e, classname, "dragbox_box")); ) - RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); + RandomSelection_AddEnt(e, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); for(entity e = NULL; (e = find(e, classname, "dragpoint")); ) - RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); + RandomSelection_AddEnt(e, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos)); if(RandomSelection_chosen_ent) { if(substring(argv(1), 0, 1) == "*") @@ -604,15 +604,15 @@ float CheatCommand(entity this, int argc) case "drag_clear": IS_CHEAT(this, 0, argc, 0); for(entity e = NULL; (e = find(e, classname, "dragbox_box")); ) - remove(e); + delete(e); for(entity e = NULL; (e = find(e, classname, "dragbox_corner_1")); ) - remove(e); + delete(e); for(entity e = NULL; (e = find(e, classname, "dragbox_corner_2")); ) - remove(e); + delete(e); for(entity e = NULL; (e = find(e, classname, "dragpoint")); ) - remove(e); + delete(e); for(entity e = NULL; (e = find(e, classname, "drag_digit")); ) - remove(e); + delete(e); DID_CHEAT(); break; case "god": @@ -639,29 +639,29 @@ float CheatCommand(entity this, int argc) break; case "noclip": IS_CHEAT(this, 0, argc, 0); - if(this.movetype != MOVETYPE_NOCLIP) + if(this.move_movetype != MOVETYPE_NOCLIP) { - this.movetype = MOVETYPE_NOCLIP; + set_movetype(this, MOVETYPE_NOCLIP); sprint(this, "noclip ON\n"); DID_CHEAT(); } else { - this.movetype = MOVETYPE_WALK; + set_movetype(this, MOVETYPE_WALK); sprint(this, "noclip OFF\n"); } break; case "fly": IS_CHEAT(this, 0, argc, 0); - if(this.movetype != MOVETYPE_FLY) + if(this.move_movetype != MOVETYPE_FLY) { - this.movetype = MOVETYPE_FLY; + set_movetype(this, MOVETYPE_FLY); sprint(this, "flymode ON\n"); DID_CHEAT(); } else { - this.movetype = MOVETYPE_WALK; + set_movetype(this, MOVETYPE_WALK); sprint(this, "flymode OFF\n"); } break; @@ -675,7 +675,7 @@ float CheatCommand(entity this, int argc) entity e = spawn(); e.target = argv(1); SUB_UseTargets(e, this, NULL); - remove(e); + delete(e); DID_CHEAT(); break; case "killtarget": @@ -683,7 +683,7 @@ float CheatCommand(entity this, int argc) entity e2 = spawn(); e2.killtarget = argv(1); SUB_UseTargets(e2, this, NULL); - remove(e2); + delete(e2); DID_CHEAT(); break; case "teleporttotarget": @@ -695,7 +695,7 @@ float CheatCommand(entity this, int argc) if(!wasfreed(ent)) { Simple_TeleportPlayer(ent, this); - remove(ent); + delete(ent); DID_CHEAT(); } break; @@ -868,9 +868,9 @@ void Drag_Begin(entity dragger, entity draggee, vector touchpoint) { float tagscale; - draggee.dragmovetype = draggee.movetype; + draggee.dragmovetype = draggee.move_movetype; draggee.draggravity = draggee.gravity; - draggee.movetype = MOVETYPE_WALK; + set_movetype(draggee, MOVETYPE_WALK); draggee.gravity = 0.00001; UNSET_ONGROUND(draggee); draggee.draggedby = dragger; @@ -895,10 +895,10 @@ void Drag_Finish(entity dragger) if(dragger) dragger.dragentity = NULL; draggee.draggedby = NULL; - draggee.movetype = draggee.dragmovetype; + set_movetype(draggee, draggee.dragmovetype); draggee.gravity = draggee.draggravity; - switch(draggee.movetype) + switch(draggee.move_movetype) { case MOVETYPE_TOSS: case MOVETYPE_WALK: @@ -913,7 +913,7 @@ void Drag_Finish(entity dragger) break; } - if((draggee.flags & FL_ITEM) && (vlen(draggee.velocity) < 32)) + if((draggee.flags & FL_ITEM) && (vdist(draggee.velocity, <, 32))) { draggee.velocity = '0 0 0'; SET_ONGROUND(draggee); // floating items are FUN