fixed all the weapon switching bugs

This commit is contained in:
Magnus Auvinen 2008-03-23 10:14:35 +00:00
parent fb64675ad6
commit e891a7a75b
2 changed files with 10 additions and 3 deletions

View file

@ -349,6 +349,12 @@ static void con_key_input_weapon(void *result, void *user_data)
input_data.wanted_weapon = w;
}
static void con_key_input_nextprev_weapon(void *result, void *user_data)
{
con_key_input_counter(result, user_data);
input_data.wanted_weapon = 0;
}
static void con_toggle_local_console(void *result, void *user_data)
{
console_toggle(0);
@ -399,8 +405,8 @@ void client_console_init()
MACRO_REGISTER_COMMAND("+weapon4", "", con_key_input_weapon, (void *)4);
MACRO_REGISTER_COMMAND("+weapon5", "", con_key_input_weapon, (void *)5);
MACRO_REGISTER_COMMAND("+nextweapon", "", con_key_input_counter, &input_data.next_weapon);
MACRO_REGISTER_COMMAND("+prevweapon", "", con_key_input_counter, &input_data.prev_weapon);
MACRO_REGISTER_COMMAND("+nextweapon", "", con_key_input_nextprev_weapon, &input_data.next_weapon);
MACRO_REGISTER_COMMAND("+prevweapon", "", con_key_input_nextprev_weapon, &input_data.prev_weapon);
MACRO_REGISTER_COMMAND("+emote", "", con_key_input_state, &emoticon_selector_active);
MACRO_REGISTER_COMMAND("+scoreboard", "", con_key_input_state, &scoreboard_active);

View file

@ -608,7 +608,8 @@ extern "C" void modc_message(int msgtype)
else if(msgtype == NETMSGTYPE_SV_WEAPON_PICKUP)
{
NETMSG_SV_WEAPON_PICKUP *msg = (NETMSG_SV_WEAPON_PICKUP *)rawmsg;
picked_up_weapon = msg->weapon+1;
if(config.cl_autoswitch_weapons)
input_data.wanted_weapon = msg->weapon+1;
}
else if(msgtype == NETMSGTYPE_SV_READY_TO_ENTER)
{