From: terencehill Date: Sun, 6 Oct 2024 10:06:16 +0000 (+0200) Subject: Fix wrong initialization of it.tur_head.aim_speed (frametime is 0.1 during worldspawn) X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a5419f695e0181e66818ddb1ebb5bf1a765c3f46;p=xonotic%2Fxonotic-data.pk3dir.git Fix wrong initialization of it.tur_head.aim_speed (frametime is 0.1 during worldspawn) --- diff --git a/qcsrc/common/turrets/turret/ewheel.qc b/qcsrc/common/turrets/turret/ewheel.qc index 4eed5b230..702662357 100644 --- a/qcsrc/common/turrets/turret/ewheel.qc +++ b/qcsrc/common/turrets/turret/ewheel.qc @@ -151,7 +151,9 @@ METHOD(EWheel, tr_think, void(EWheel thistur, entity it)) real_angle = shortangle_vxy(real_angle, it.tur_head.angles); it.tur_head.spawnshieldtime = fabs(real_angle_y); - real_angle_y = bound(-it.tur_head.aim_speed, real_angle_y, it.tur_head.aim_speed); + + float f = it.tur_head.aim_speed * frametime; + real_angle_y = bound(-f, real_angle_y, f); it.angles_y = (it.angles_y + real_angle_y); if(it.enemy) @@ -206,7 +208,7 @@ METHOD(EWheel, tr_setup, void(EWheel this, entity it)) it.frame = it.tur_head.frame = 1; it.ammo_flags = TFL_AMMO_ENERGY | TFL_AMMO_RECHARGE | TFL_AMMO_RECIEVE; - it.tur_head.aim_speed = autocvar_g_turrets_unit_ewheel_turnrate * frametime; + it.tur_head.aim_speed = autocvar_g_turrets_unit_ewheel_turnrate; } #endif // SVQC