]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cheats.qc
Merge remote-tracking branch 'origin/master' into samual/update_effects_tab
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cheats.qc
index 12dfdad9b5001c9b70ac95017ec3535bfdd0fdbe..017999d761becfb892d56dc535ff8f2c43a9a148 100644 (file)
@@ -48,7 +48,7 @@ float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as a
        // dead people cannot cheat
        if(self.deadflag != DEAD_NO)
                return 0;
-       if(self.classname != "player")
+       if(gamestart_sv_cheats < 2 && !IS_PLAYER(self))
                return 0;
        
        // sv_clones
@@ -236,7 +236,7 @@ float CheatImpulse(float i)
                                        break;
                                }
                        }
-                       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))
+                       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) ? 100 : 100000), 1024, 256))
                        {
                                sprint(self, "Emergency teleport used random location\n");
                                self.angles_x = -self.angles_x;
@@ -943,9 +943,9 @@ float Drag_IsDraggable(entity draggee)
                return FALSE;
 //     if(draggee.model == "")
 //             return FALSE;
-       if(draggee.classname == "spectator")
+       if(IS_SPEC(draggee))
                return FALSE;
-       if(draggee.classname == "observer")
+       if(IS_OBSERVER(draggee))
                return FALSE;
        if(draggee.classname == "exteriorweaponentity")
                return FALSE;
@@ -1011,7 +1011,7 @@ void Drag_Update(entity dragger)
 
 float Drag_CanDrag(entity dragger)
 {
-       return (dragger.deadflag == DEAD_NO) || (dragger.classname == "player");
+       return (dragger.deadflag == DEAD_NO) || (IS_PLAYER(dragger));
 }
 
 float Drag_IsDragging(entity dragger)