X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcheats.qc;h=5d6fba14fd8a2247aba7b8fd189635a2fe9f3ac2;hb=75a369ff551c693e05841164bfedc9c3d21838d0;hp=7ecacb29a1f0828b7813c5956589138990ae3613;hpb=3589bb7872babf0ee489a54c85c9213562c1ffe9;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 7ecacb29a..5d6fba14f 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -1,17 +1,15 @@ #include "cheats.qh" -#include "_all.qh" #include "g_damage.qh" #include "race.qh" #include "../common/triggers/teleporters.qh" -#include "mutators/mutators_include.qh" +#include "mutators/all.qh" #include "weapons/tracing.qh" #include "../common/constants.qh" #include "../common/deathtypes/all.qh" -#include "../common/effects/effects.qh" #include "../common/util.qh" #include "../common/monsters/all.qh" @@ -22,10 +20,10 @@ #include "../common/triggers/func/breakable.qh" -#include "../csqcmodellib/sv_model.qh" +#include "../lib/csqcmodel/sv_model.qh" -#include "../warpzonelib/anglestransform.qh" -#include "../warpzonelib/util_server.qh" +#include "../lib/warpzone/anglestransform.qh" +#include "../lib/warpzone/util_server.qh" void CopyBody(float keepvelocity); @@ -152,8 +150,7 @@ float CheatImpulse(float i) // shared with regular waypoint init, so this is not a cheat by itself if(!self.personal) { - self.personal = spawn(); - self.personal.classname = "personal_wp"; + self.personal = new(personal_wp); } self.personal.origin = self.origin; self.personal.v_angle = self.v_angle; @@ -340,7 +337,7 @@ float CheatCommand(float argc) effectnum = _particleeffectnum(argv(1)); 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); + __trailparticles(self, effectnum, w_shotorg, trace_endpos); DID_CHEAT(); break; } @@ -404,8 +401,7 @@ float CheatCommand(float argc) break; case "dragbox_spawn": { IS_CHEAT(0, argc, 0); - entity e = spawn(); - e.classname = "dragbox_box"; + entity e = new(dragbox_box); e.think = DragBox_Think; e.nextthink = time; e.solid = -1; // black @@ -415,8 +411,7 @@ float CheatCommand(float argc) else e.cnt = max(0, drag_lastcnt); - e.aiment = spawn(); - e.aiment.classname = "dragbox_corner_1"; + e.aiment = new(dragbox_corner_1); e.aiment.owner = e; setmodel(e.aiment, MDL_MARKER); e.aiment.skin = 0; @@ -429,8 +424,7 @@ float CheatCommand(float argc) setorigin(e.aiment, trace_endpos); } - e.enemy = spawn(); - e.enemy.classname = "dragbox_corner_2"; + e.enemy = new(dragbox_corner_2); e.enemy.owner = e; setmodel(e.enemy, MDL_MARKER); e.enemy.skin = 1; @@ -444,13 +438,11 @@ float CheatCommand(float argc) else setorigin(e.enemy, e.aiment.origin + 32 * end); - e.killindicator = spawn(); - e.killindicator.classname = "drag_digit"; + e.killindicator = new(drag_digit); e.killindicator.owner = e; setattachment(e.killindicator, e, ""); setorigin(e.killindicator, '0 0 -8'); - e.killindicator.killindicator = spawn(); - e.killindicator.killindicator.classname = "drag_digit"; + e.killindicator.killindicator = new(drag_digit); e.killindicator.killindicator.owner = e; setattachment(e.killindicator.killindicator, e, ""); setorigin(e.killindicator.killindicator, '0 0 8'); @@ -459,8 +451,7 @@ float CheatCommand(float argc) } case "dragpoint_spawn": { IS_CHEAT(0, argc, 0); - entity e = spawn(); - e.classname = "dragpoint"; + entity e = new(dragpoint); e.think = DragBox_Think; e.nextthink = time; e.solid = 0; // nothing special @@ -480,13 +471,11 @@ float CheatCommand(float argc) move_out_of_solid(e); } - e.killindicator = spawn(); - e.killindicator.classname = "drag_digit"; + e.killindicator = new(drag_digit); e.killindicator.owner = e; setattachment(e.killindicator, e, ""); setorigin(e.killindicator, '0 0 40'); - e.killindicator.killindicator = spawn(); - e.killindicator.killindicator.classname = "drag_digit"; + e.killindicator.killindicator = new(drag_digit); e.killindicator.killindicator.owner = e; setattachment(e.killindicator.killindicator, e, ""); setorigin(e.killindicator.killindicator, '0 0 56'); @@ -715,9 +704,8 @@ float CheatCommand(float argc) break; case "teleporttotarget": IS_CHEAT(0, argc, 0); - setself(spawn()); + setself(new(cheattriggerteleport)); setorigin(self, self.origin); - self.classname = "cheattriggerteleport"; self.target = argv(1); teleport_findtarget(); if(!wasfreed(self)) @@ -1027,8 +1015,9 @@ void Drag_Update(entity dragger) draggee.ltime = max(servertime + serverframetime, draggee.ltime); // fixes func_train breakage vector vecs = '0 0 0'; - if(dragger.weaponentity.movedir_x > 0) - vecs = dragger.weaponentity.movedir; + .entity weaponentity = weaponentities[0]; // TODO: unhardcode + if(dragger.(weaponentity).movedir.x > 0) + vecs = dragger.(weaponentity).movedir; vector dv = v_right * -vecs_y + v_up * vecs_z;