From b14abd47499e945852cf6dc98d85331908ce1b56 Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 10 Mar 2013 03:11:16 +0000 Subject: [PATCH] Add stub which_bomb to match D2X code --- main/gauges.c | 2 +- main/laser.c | 3 ++- main/weapon.h | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/main/gauges.c b/main/gauges.c index d5a7c4f16..6e99655f8 100644 --- a/main/gauges.c +++ b/main/gauges.c @@ -987,7 +987,7 @@ void show_bomb_count(int x,int y,int bg_color,int always_show,int right_align) if (!PlayerCfg.BombGauge) return; - bomb = PROXIMITY_INDEX; + bomb = which_bomb(); count = Players[Player_num].secondary_ammo[bomb]; count = min(count,99); //only have room for 2 digits - cheating give 200 diff --git a/main/laser.c b/main/laser.c index f15864ab6..c8b6cf169 100644 --- a/main/laser.c +++ b/main/laser.c @@ -1383,7 +1383,8 @@ int Missile_gun=0, Proximity_dropped = 0; //changed on 9/16/98 by adb to distinguish between drop bomb and secondary fire void do_missile_firing(int drop_bomb) { - int weapon = (drop_bomb) ? PROXIMITY_INDEX : Secondary_weapon; + int bomb = which_bomb(); + int weapon = (drop_bomb) ? bomb : Secondary_weapon; Network_laser_track = -1; diff --git a/main/weapon.h b/main/weapon.h index 3d226057a..4bdfc9117 100644 --- a/main/weapon.h +++ b/main/weapon.h @@ -179,4 +179,10 @@ extern void maybe_select_secondary(int weapon_index); */ extern int weapon_info_read_n(weapon_info *wi, int n, PHYSFS_file *fp); +//return which bomb will be dropped next time the bomb key is pressed +static inline int which_bomb(void) +{ + return PROXIMITY_INDEX; +} + #endif