]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cheats.qc
Merge branch 'master' into Mario/race_target_waypoint
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cheats.qc
index d54feeac84111662ae3d320880b488c38775c902..ded5e8409885efa1500d13237e5b2b2921bdab45 100644 (file)
@@ -153,7 +153,7 @@ float CheatImpulse(entity this, int imp)
                        this.personal.ammo_plasma = this.ammo_plasma;
                        this.personal.ammo_shells = this.ammo_shells;
                        this.personal.ammo_fuel = this.ammo_fuel;
-                       this.personal.health = this.health;
+                       this.personal.health = max(1, this.health);
                        this.personal.armorvalue = this.armorvalue;
                        this.personal.weapons = this.weapons;
                        this.personal.items = this.items;
@@ -882,7 +882,7 @@ void Drag_Begin(entity dragger, entity draggee, vector touchpoint)
        dragger.dragdistance = vlen(touchpoint - dragger.origin - dragger.view_ofs);
        dragger.draglocalangle = draggee.angles.y - dragger.v_angle.y;
        touchpoint = touchpoint - gettaginfo(draggee, 0);
-       tagscale = pow(vlen(v_forward), -2);
+       tagscale = (vlen(v_forward) ** -2);
        dragger.draglocalvector_x = touchpoint * v_forward * tagscale;
        dragger.draglocalvector_y = touchpoint * v_right * tagscale;
        dragger.draglocalvector_z = touchpoint * v_up * tagscale;
@@ -964,7 +964,7 @@ void Drag_MoveForward(entity dragger)
 
 void Drag_SetSpeed(entity dragger, float s)
 {
-       dragger.dragspeed = pow(2, s);
+       dragger.dragspeed = (2 ** s);
 }
 
 void Drag_MoveBackward(entity dragger)