]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix MOVETYPE_FOLLOW
authorMario <mario@smbclan.net>
Sat, 18 Jun 2016 12:32:39 +0000 (22:32 +1000)
committerMario <mario@smbclan.net>
Sat, 18 Jun 2016 12:32:39 +0000 (22:32 +1000)
qcsrc/common/physics/movetypes/follow.qc
qcsrc/common/physics/movetypes/movetypes.qh

index 2d3e24f44c93ec5e8d4f34b0800d806336f2039d..421c0e73f62daa67a65cef9f14d98fe191eeaefe 100644 (file)
@@ -1,31 +1,29 @@
 void _Movetype_Physics_Follow(entity this) // SV_Physics_Follow
 {
-       entity e = this.move_aiment; // TODO: networking?
+       entity e = this.aiment;
 
-       // LordHavoc: implemented rotation on MOVETYPE_FOLLOW objects
-       if(this.move_angles == this.move_punchangle)
+       if(e.angles == this.punchangle)
        {
-               this.move_origin = e.move_origin + this.view_ofs;
+               this.move_origin = e.origin + this.view_ofs;
        }
        else
        {
                vector ang, v;
-               ang_x = -this.move_punchangle_x;
-               ang_y = this.move_punchangle_y;
-               ang_z = this.move_punchangle_z;
+               ang_x = -this.punchangle_x;
+               ang_y = this.punchangle_y;
+               ang_z = this.punchangle_z;
                makevectors(ang);
                v_x = this.view_ofs_x * v_forward_x + this.view_ofs_y * v_right_x + this.view_ofs_z * v_up_x;
                v_y = this.view_ofs_x * v_forward_y + this.view_ofs_y * v_right_y + this.view_ofs_z * v_up_y;
                v_z = this.view_ofs_x * v_forward_z + this.view_ofs_y * v_right_z + this.view_ofs_z * v_up_z;
-               ang_x = -e.move_angles_x;
-               ang_y = e.move_angles_y;
-               ang_z = e.move_angles_z;
+               ang = e.angles;
+               ang_x = -e.angles_x;
                makevectors(ang);
-               this.move_origin_x = v_x * v_forward_x + v_y * v_forward_y + v_z * v_forward_z + e.move_origin_x;
-               this.move_origin_x = v_x * v_right_x + v_y * v_right_y + v_z * v_right_z + e.move_origin_y;
-               this.move_origin_x = v_x * v_up_x + v_y * v_up_y + v_z * v_up_z + e.move_origin_z;
+               this.move_origin_x = v_x * v_forward_x + v_y * v_forward_y + v_z * v_forward_z + e.origin_x;
+               this.move_origin_x = v_x * v_right_x + v_y * v_right_y + v_z * v_right_z + e.origin_y;
+               this.move_origin_x = v_x * v_up_x + v_y * v_up_y + v_z * v_up_z + e.origin_z;
        }
 
-       this.move_angles = e.move_angles + this.v_angle;
+       this.move_angles = e.angles + this.v_angle;
        _Movetype_LinkEdict(this, false);
 }
index 61b7e94a954f43d740bf73ec275f80db394be125..764b993805ad55ec44a864e806e79dd98ad5529d 100644 (file)
@@ -24,8 +24,8 @@
 .float move_bounce_stopspeed;
 .float move_nomonsters;  // -1 for MOVE_NORMAL, otherwise a MOVE_ constant
 
-.entity move_aiment;
-.vector move_punchangle;
+.entity aiment;
+.vector punchangle;
 
 // should match sv_gameplayfix_fixedcheckwatertransition
 float autocvar_cl_gameplayfix_fixedcheckwatertransition = 1;