]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cheats.qc
Bring back some old hacks to allow taunting while spectating/observing
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cheats.qc
index e7a13b3f90d4e46dd3bfb76e022d8dc21744d031..b82b19a4a7f3a9593e20c556a41ccc27c14562df 100644 (file)
@@ -12,6 +12,8 @@
 #include "../common/deathtypes/all.qh"
 #include "../common/util.qh"
 
+#include <common/physics/player.qh>
+
 #include "../common/monsters/all.qh"
 
 #include "../common/weapons/all.qh"
@@ -25,7 +27,7 @@
 #include "../lib/warpzone/anglestransform.qh"
 #include "../lib/warpzone/util_server.qh"
 
-void CopyBody(float keepvelocity);
+void CopyBody(entity this, float keepvelocity);
 
 #ifdef NOCHEATS
 
@@ -34,7 +36,6 @@ float CheatCommand(float argc) { return 0; }
 float CheatFrame() { return 0; }
 void CheatInit() { cheatcount_total = world.cheatcount; }
 void CheatShutdown() { }
-void CheatShutdownClient() { }
 void Drag_MoveDrag(entity from, entity to) { }
 
 #else
@@ -53,10 +54,6 @@ void CheatShutdown()
 {
 }
 
-void CheatShutdownClient()
-{
-}
-
 float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as argument for possible future ACL checking
 {SELFPARAM();
        // dead people cannot cheat
@@ -172,14 +169,14 @@ float CheatImpulse(int imp)
                        IS_CHEAT(imp, 0, 0);
                        makevectors (self.v_angle);
                        self.velocity = self.velocity + v_forward * 300;
-                       CopyBody(1);
+                       CopyBody(self, 1);
                        self.lip += 1;
                        self.velocity = self.velocity - v_forward * 300;
                        DID_CHEAT();
                        break;
                case CHIMPULSE_CLONE_STANDING.impulse:
                        IS_CHEAT(imp, 0, 0);
-                       CopyBody(0);
+                       CopyBody(self, 0);
                        self.lip += 1;
                        DID_CHEAT();
                        break;
@@ -784,7 +781,7 @@ float Drag(float force_allow_pick, float ischeat)
                default:
                        if(Drag_IsDragging(self))
                        {
-                               if(self.BUTTON_DRAG)
+                               if(PHYS_INPUT_BUTTON_DRAG(self))
                                {
                                        if(self.impulse == 10 || self.impulse == 15 || self.impulse == 18)
                                        {
@@ -816,7 +813,7 @@ float Drag(float force_allow_pick, float ischeat)
                        else
                        {
                                if(Drag_CanDrag(self))
-                                       if(self.BUTTON_DRAG)
+                                       if(PHYS_INPUT_BUTTON_DRAG(self))
                                        {
                                                crosshair_trace_plusvisibletriggers(self);
                                                entity e = trace_ent;