1
This commit is contained in:
parent
b0c3333572
commit
22f375673a
@ -193,15 +193,42 @@ void Player::Shot()
|
||||
bullet->Initialize();
|
||||
room->AddBullet(bullet);
|
||||
}
|
||||
switch (curr_weapon->meta->i->_inventory_slot()) {
|
||||
int slot_id = curr_weapon->meta->i->_inventory_slot();
|
||||
switch (slot_id) {
|
||||
case 5:
|
||||
{
|
||||
//手雷
|
||||
if (inventory[slot_id] > 0) {
|
||||
--inventory[slot_id];
|
||||
} else {
|
||||
int weapon_idx = curr_weapon->weapon_idx;
|
||||
*curr_weapon = Weapon();
|
||||
curr_weapon->weapon_idx = weapon_idx;
|
||||
if (weapons[SMOKE_SLOT].weapon_id != 0) {
|
||||
curr_weapon = &weapons[SMOKE_SLOT];
|
||||
} else {
|
||||
curr_weapon = &weapons[0];
|
||||
}
|
||||
}
|
||||
need_sync_active_player = true;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
{
|
||||
//烟雾弹
|
||||
if (inventory[slot_id] > 0) {
|
||||
--inventory[slot_id];
|
||||
} else {
|
||||
int weapon_idx = curr_weapon->weapon_idx;
|
||||
*curr_weapon = Weapon();
|
||||
curr_weapon->weapon_idx = weapon_idx;
|
||||
if (weapons[FRAG_SLOT].weapon_id != 0) {
|
||||
curr_weapon = &weapons[FRAG_SLOT];
|
||||
} else {
|
||||
curr_weapon = &weapons[0];
|
||||
}
|
||||
}
|
||||
need_sync_active_player = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user