]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
q3df compat: only simulate q3df target_speed bugs when using Q3COMPAT
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sat, 4 Feb 2023 10:27:19 +0000 (11:27 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Sat, 4 Feb 2023 10:27:19 +0000 (11:27 +0100)
qcsrc/common/mapobjects/target/speed.qc

index 7ad194bfeb5c02c9dd7eb50f306d1a1ddb32ac16..1862f519813f496e782bd71dc2cbe322fbdde24d 100644 (file)
@@ -50,6 +50,12 @@ vector target_speed_calculatevelocity(entity this, float speed, entity pushed_en
 
        float launcherspeed = 0;
 
+       if(!STAT(Q3COMPAT)) // no need to simulate this bug
+       {
+               launcherspeed += speed;
+               if(is_add) launcherspeed += oldspeed; // add the add speed in the same variable as it goes in the same direction
+       }
+
        FOR_XYZ(i)
        {
                if(((pushvel[i] != 0) || is_launcher) && (is_positive[i] != is_negative[i]))
@@ -57,8 +63,11 @@ vector target_speed_calculatevelocity(entity this, float speed, entity pushed_en
                        if(is_launcher)
                        {
                                pushvel[i] = 1; // every direction weighs the same amount on launchers, movedir does not matter
-                               launcherspeed += speed;
-                               if(is_add) launcherspeed += oldspeed; // add the add speed in the same variable as it goes in the same direction
+                               if(STAT(Q3COMPAT))
+                               {
+                                       launcherspeed += speed;
+                                       if(is_add) launcherspeed += oldspeed; // add the add speed in the same variable as it goes in the same direction
+                               }
                        }
 
                        if(is_positive[i])