X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcheats.qc;h=5ca5270d614dda0b5212a827c5fa5922162e8f51;hb=c66a78d068945e0dce54d7eb640395c782207fb0;hp=04172b5eb2b59d74de854c3c1d440ad4c5f7827a;hpb=bc3f297ed082b23fb33dd0d8f5dcd33bb0198507;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 04172b5eb..5ca5270d6 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -6,6 +6,7 @@ #include #include "g_damage.qh" +#include "clientkill.qh" #include "player.qh" #include "race.qh" #include "../common/mapobjects/teleporters.qh" @@ -45,7 +46,7 @@ void Drag_MoveDrag(entity from, entity to) { } #else -.float maycheat; +.bool maycheat; float gamestart_sv_cheats; @@ -59,7 +60,7 @@ void CheatShutdown() { } -float CheatsAllowed(entity this, float i, float argc, float fr) // the cheat gets passed as argument for possible future ACL checking +float CheatsAllowed(entity this, float i, int argc, float fr) // the cheat gets passed as argument for possible future ACL checking { // dead people cannot cheat if(IS_DEAD(this)) @@ -838,7 +839,7 @@ float Drag(entity this, float force_allow_pick, float ischeat) } // Find e and pick if(e && pick) - if(Drag_IsDraggable(e)) + if(Drag_IsDraggable(e, this)) { if(ischeat) IS_CHEAT(this, 0, 0, CHRAME_DRAG); @@ -914,31 +915,24 @@ void Drag_Finish(entity dragger) } } -float Drag_IsDraggable(entity draggee) +bool drag_undraggable(entity draggee, entity dragger) +{ + // stuff probably shouldn't need this, we should figure out why they do! + // exceptions of course are observers and weapon entities, where things mess up + return false; +} + +float Drag_IsDraggable(entity draggee, entity dragger) { // TODO add more checks for bad stuff here if(draggee == NULL) return false; - if(draggee.classname == "func_bobbing") - return false; if(draggee.classname == "door") // FIXME find out why these must be excluded, or work around the problem (trying to drag these causes like 4 fps) - return false; - if(draggee.classname == "plat") - return false; - if(draggee.classname == "func_button") - return false; + return false; // probably due to BSP collision // if(draggee.model == "") // return false; - if(IS_SPEC(draggee)) - return false; - if(IS_OBSERVER(draggee)) - return false; - if(draggee.classname == "exteriorweaponentity") - return false; - if(draggee.classname == "weaponentity") - return false; - return true; + return ((draggee.draggable) ? draggee.draggable(draggee, dragger) : true); } float Drag_MayChangeAngles(entity draggee) @@ -1016,7 +1010,7 @@ float Drag_IsDragging(entity dragger) dragger.dragentity = NULL; return false; } - if(!Drag_CanDrag(dragger) || !Drag_IsDraggable(dragger.dragentity)) + if(!Drag_CanDrag(dragger) || !Drag_IsDraggable(dragger.dragentity, dragger)) { Drag_Finish(dragger); return false;