From 653a201993570554d2c13fce657ad30cc18af2ca Mon Sep 17 00:00:00 2001 From: chief1983 Date: Mon, 7 Jun 2010 16:28:02 +0000 Subject: [PATCH] Backport of 6122: Fix a bug where additive weapon velocity would sometimes cause primary shots to pass through a target --- code/object/objcollide.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/object/objcollide.cpp b/code/object/objcollide.cpp index fb58c5f3bf..1fa8c6aecb 100644 --- a/code/object/objcollide.cpp +++ b/code/object/objcollide.cpp @@ -753,12 +753,14 @@ int weapon_will_never_hit( object *obj_weapon, object *other, obj_pair * current float max_vel_weapon, max_vel_other; - max_vel_weapon = wp->weapon_max_vel; - - if ((wp->lssm_stage==5)) - { + //SUSHI: Fix bug where additive weapon velocity screws up collisions + //Assumes that weapons which don't home don't change speed, which is currently the case. + if (!(wip->wi_flags & WIF_TURNS)) + max_vel_weapon = obj_weapon->phys_info.speed; + else if ((wp->lssm_stage==5)) max_vel_weapon = wip->lssm_stage5_vel; - } + else + max_vel_weapon = wp->weapon_max_vel; max_vel_other = other->phys_info.max_vel.xyz.z; if (max_vel_other < 10.0f) {