Skip to content

Commit e57cd8a

Browse files
committed
fix burst mult bug
1 parent 60e7e85 commit e57cd8a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

code/ai/aiturret.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,8 +1555,9 @@ void turret_set_next_fire_timestamp(int weapon_num, const weapon_info *wip, ship
15551555
Assert(weapon_num < MAX_SHIP_WEAPONS);
15561556
float wait = 1000.0f;
15571557
// should subtract 1 from firepoints to match behavior of wip->burst_shots
1558-
int burst_shots = (wip->burst_flags[Weapon::Burst_Flags::Num_firepoints_burst_shots] ? turret->system_info->turret_num_firing_points - 1 : wip->burst_shots);
1559-
burst_shots = fl2i(i2fl(burst_shots) * wip->weapon_launch_curves.get_output(weapon_info::WeaponLaunchCurveOutputs::BURST_SHOTS_MULT, launch_curve_data));
1558+
int base_burst_shots = (wip->burst_flags[Weapon::Burst_Flags::Num_firepoints_burst_shots] ? turret->system_info->turret_num_firing_points - 1 : wip->burst_shots) + 1;
1559+
float burst_shots_mult = wip->weapon_launch_curves.get_output(weapon_info::WeaponLaunchCurveOutputs::BURST_SHOTS_MULT, launch_curve_data);
1560+
int burst_shots = MAX(fl2i(i2fl(base_burst_shots) * burst_shots_mult) - 1, 0);
15601561

15611562
if (burst_shots > turret->weapons.burst_counter[weapon_num]) {
15621563
wait *= wip->burst_delay;

0 commit comments

Comments
 (0)