do not select weapon if guide-bot shortcut has done and weapon key is mapped from 0 to 9
This commit is contained in:
parent
48a163cf1f
commit
442e669dc5
|
@ -4,6 +4,7 @@ D2X-Rebirth Changelog
|
|||
--------
|
||||
main/object.c: removing the !dead statement (leftover from WraithX Deathcam) from object_move_one() so the function will return correctly if player dies instead running further and creating invalid code and crashes
|
||||
arch/cocoa/d2x-rebirth.icns: update to Novacron's 128x128-bit icon
|
||||
main/kconfig.c: do not select weapon if guide-bot shortcut has done and weapon key is mapped from 0 to 9
|
||||
|
||||
20070112
|
||||
--------
|
||||
|
|
|
@ -2845,63 +2845,64 @@ void controls_read_all()
|
|||
if(key_down_count(kc_d2x[0].value) ||
|
||||
(joy_get_button_state(kc_d2x[1].value) &&
|
||||
(d2x_joystick_state[0]!=d2x_joystick_ostate[0]) ) )
|
||||
{
|
||||
//int i, valu=0;
|
||||
do_weapon_select(0,0);
|
||||
/*
|
||||
for(i=MAX_PRIMARY_WEAPONS;i<MAX_PRIMARY_WEAPONS+NEWPRIMS;i++)
|
||||
if(primary_order[i]>primary_order[valu]&&player_has_weapon(i,0))
|
||||
valu = i;
|
||||
LaserPowSelected = valu;
|
||||
*/
|
||||
}
|
||||
if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[0].value >= 2 && kc_d2x[0].value <= 11))) // this (and the following statements) prevents to select weapon if guide-bot shortcut has done and weapon key is mapped from 0 to 9
|
||||
do_weapon_select(0,0);
|
||||
//----------------Weapon 2----------------
|
||||
if(key_down_count(kc_d2x[2].value) ||
|
||||
(joy_get_button_state(kc_d2x[3].value) &&
|
||||
(d2x_joystick_state[1]!=d2x_joystick_ostate[1]) ) )
|
||||
do_weapon_select(1,0);
|
||||
if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[2].value >= 2 && kc_d2x[2].value <= 11)))
|
||||
do_weapon_select(1,0);
|
||||
//----------------Weapon 3----------------
|
||||
if(key_down_count(kc_d2x[4].value) ||
|
||||
(joy_get_button_state(kc_d2x[5].value) &&
|
||||
(d2x_joystick_state[2]!=d2x_joystick_ostate[2]) ) )
|
||||
do_weapon_select(2,0);
|
||||
if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[4].value >= 2 && kc_d2x[4].value <= 11)))
|
||||
do_weapon_select(2,0);
|
||||
//----------------Weapon 4----------------
|
||||
if(key_down_count(kc_d2x[6].value) ||
|
||||
(joy_get_button_state(kc_d2x[7].value) &&
|
||||
(d2x_joystick_state[3]!=d2x_joystick_ostate[3]) ) )
|
||||
do_weapon_select(3,0);
|
||||
if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[6].value >= 2 && kc_d2x[6].value <= 11)))
|
||||
do_weapon_select(3,0);
|
||||
//----------------Weapon 5----------------
|
||||
if(key_down_count(kc_d2x[8].value) ||
|
||||
(joy_get_button_state(kc_d2x[9].value) &&
|
||||
(d2x_joystick_state[4]!=d2x_joystick_ostate[4]) ) )
|
||||
do_weapon_select(4,0);
|
||||
if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[8].value >= 2 && kc_d2x[8].value <= 11)))
|
||||
do_weapon_select(4,0);
|
||||
|
||||
//--------- Read secondary weapon select ----------
|
||||
//----------------Weapon 6----------------
|
||||
if(key_down_count(kc_d2x[10].value) ||
|
||||
(joy_get_button_state(kc_d2x[11].value) &&
|
||||
(d2x_joystick_state[5]!=d2x_joystick_ostate[5]) ) )
|
||||
do_weapon_select(0,1);
|
||||
if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[10].value >= 2 && kc_d2x[10].value <= 11)))
|
||||
do_weapon_select(0,1);
|
||||
//----------------Weapon 7----------------
|
||||
if(key_down_count(kc_d2x[12].value) ||
|
||||
(joy_get_button_state(kc_d2x[13].value) &&
|
||||
(d2x_joystick_state[6]!=d2x_joystick_ostate[6]) ) )
|
||||
do_weapon_select(1,1);
|
||||
if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[12].value >= 2 && kc_d2x[12].value <= 11)))
|
||||
do_weapon_select(1,1);
|
||||
//----------------Weapon 8----------------
|
||||
if(key_down_count(kc_d2x[14].value) ||
|
||||
(joy_get_button_state(kc_d2x[15].value) &&
|
||||
(d2x_joystick_state[7]!=d2x_joystick_ostate[7]) ) )
|
||||
do_weapon_select(2,1);
|
||||
if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[14].value >= 2 && kc_d2x[14].value <= 11)))
|
||||
do_weapon_select(2,1);
|
||||
//----------------Weapon 9----------------
|
||||
if(key_down_count(kc_d2x[16].value) ||
|
||||
(joy_get_button_state(kc_d2x[17].value) &&
|
||||
(d2x_joystick_state[8]!=d2x_joystick_ostate[8]) ) )
|
||||
do_weapon_select(3,1);
|
||||
if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[16].value >= 2 && kc_d2x[16].value <= 11)))
|
||||
do_weapon_select(3,1);
|
||||
//----------------Weapon 0----------------
|
||||
if(key_down_count(kc_d2x[18].value) ||
|
||||
(joy_get_button_state(kc_d2x[19].value) &&
|
||||
(d2x_joystick_state[9]!=d2x_joystick_ostate[9]) ) )
|
||||
do_weapon_select(4,1);
|
||||
if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[18].value >= 2 && kc_d2x[18].value <= 11)))
|
||||
do_weapon_select(4,1);
|
||||
memcpy(d2x_joystick_ostate,d2x_joystick_state,10*sizeof(int));
|
||||
}
|
||||
//end this section addition - VR
|
||||
|
|
Loading…
Reference in a new issue