From 4ac47d5b18aa8380ce6b61321a25a688a46941aa Mon Sep 17 00:00:00 2001 From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Sat, 4 Feb 2023 11:27:19 +0100 Subject: [PATCH] q3df compat: only simulate q3df target_speed bugs when using Q3COMPAT --- qcsrc/common/mapobjects/target/speed.qc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/mapobjects/target/speed.qc b/qcsrc/common/mapobjects/target/speed.qc index 7ad194bfe..1862f5198 100644 --- a/qcsrc/common/mapobjects/target/speed.qc +++ b/qcsrc/common/mapobjects/target/speed.qc @@ -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]) -- 2.39.2