Skip to content

Commit 54e052b

Browse files
committed
Don't assume non-turning weapons have a fixed velocity.
Somewhat related to PR #528, this changes the branch that assumes constant velocity from checking for an absence of the WIF_TURNS flag to checking for the presence of the PF_CONST_VEL flag (because non-turning weapons can be given an acceleration time).
1 parent 17c6b7c commit 54e052b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

code/object/objcollide.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,8 +788,8 @@ int weapon_will_never_hit( object *obj_weapon, object *other, obj_pair * current
788788
float max_vel_weapon, max_vel_other;
789789

790790
//SUSHI: Fix bug where additive weapon velocity screws up collisions
791-
//Assumes that weapons which don't home don't change speed, which is currently the case.
792-
if (!(wip->wi_flags & WIF_TURNS))
791+
//If the PF_CONST_VEL flag is set, we can safely assume it doesn't change speed.
792+
if (obj_weapon->phys_info.flags & PF_CONST_VEL)
793793
max_vel_weapon = obj_weapon->phys_info.speed;
794794
else if (wp->lssm_stage==5)
795795
max_vel_weapon = wip->lssm_stage5_vel;

0 commit comments

Comments
 (0)