X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcheats.qc;h=d2a21edc1002e0f27202b788ff2eea689e373bd5;hb=9c4f14b8fe9673393d02749d86d2da245cb02e25;hp=8e455e942b8b8a9561d1a5d53a760373ad6296d7;hpb=dc1a34293241f9da4808ff65ca0a1b3dc43fd31a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 8e455e942..d2a21edc1 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -683,11 +683,9 @@ float CheatFrame() BEGIN_CHEAT_FUNCTION(); // Dragging can be used as either a cheat, or a function for some objects. If sv_cheats is active, - // the cheat dragging is used (unlimited pickup range and any entity can be carried), even if - // g_grab is enabled. Is sv_cheats is disabled but g_grab is not, normal dragging is - // used (limited pickup range and only dragable objects can be carried), grabbing itself - // no longer being accounted as cheating. If both sv_cheats and g_grab are disabled, players - // attempting to grab objects are reported as trying to cheat. + // the cheat dragging is used (unlimited pickup range and any entity can be carried). If sv_cheats + // is disabled, normal dragging is used (limited pickup range and only dragable objects can be carried), + // grabbing itself no longer being accounted as cheating. switch(0) { @@ -700,7 +698,7 @@ float CheatFrame() if(Drag(trace_ent, TRUE)) DID_CHEAT(); } - else if(autocvar_g_grab) + else { // drag is TRUE if the object can be picked up. While an object is being carried, the Drag() function // must execute for it either way, otherwise it would cause bugs if it went out of the player's trace. @@ -719,9 +717,7 @@ float CheatFrame() drag = TRUE; break; case 2: // owner and team mates can grab - if(trace_ent.owner == self || trace_ent.realowner == self) - drag = TRUE; - if(!IsDifferentTeam(trace_ent.owner, self) || !IsDifferentTeam(trace_ent.realowner, self)) + if(!IsDifferentTeam(trace_ent.owner, self) || !IsDifferentTeam(trace_ent.realowner, self) || trace_ent.team == self.team) drag = TRUE; break; case 3: // anyone can grab @@ -732,11 +728,6 @@ float CheatFrame() } Drag(trace_ent, drag); // execute dragging } - else if(self.BUTTON_DRAG) - { - // consider dragging a cheat if g_grab is disabled - IS_CHEAT(0, 0, CHRAME_DRAG); - } break; } @@ -749,11 +740,11 @@ float CheatFrame() // ENTITY DRAGGING -float Drag(entity e, float grab) +float Drag(entity e, float pick) { // returns TRUE when an entity has been picked up - // If grab is TRUE, the object can also be picked up if it's not being held already - // If grab is FALSE, only keep dragging the object if it's already being held + // If pick is TRUE, the object can also be picked up if it's not being held already + // If pick is FALSE, only keep dragging the object if it's already being held if(Drag_IsDragging(self)) { @@ -789,7 +780,7 @@ float Drag(entity e, float grab) else { if(Drag_CanDrag(self)) - if(self.BUTTON_DRAG && grab) + if(self.BUTTON_DRAG && pick) { if(e) if(Drag_IsDraggable(e))