This commit is contained in:
aozhiwei 2019-07-04 15:59:21 +08:00
parent 08e83756ad
commit 6ee992ae0b

View File

@ -226,53 +226,6 @@ void Human::Shot(a8::Vec2& target_dir)
room->CreateBullet(this, curr_weapon, bullet_born_pos, attack_dir, fly_distance);
}
--curr_weapon->ammo;
#if 0
int slot_id = curr_weapon->meta->i->_inventory_slot();
switch (slot_id) {
case 5:
{
//手雷
if (GetInventory(slot_id) > 0) {
DecInventory(slot_id, 1);
++curr_weapon->ammo;
} 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];
}
AutoLoadingBullet();
}
need_sync_active_player = true;
SyncAroundPlayers();
}
break;
case 6:
{
//烟雾弹
if (GetInventory(slot_id) > 0) {
DecInventory(slot_id, 1);
++curr_weapon->ammo;
} 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];
}
AutoLoadingBullet();
}
need_sync_active_player = true;
SyncAroundPlayers();
}
break;
}
#endif
last_shot_frameno_ = room->frame_no;
need_sync_active_player = true;
}