修复手榴弹问题

This commit is contained in:
aozhiwei 2019-05-23 16:27:21 +08:00
parent 72def7cf5e
commit 173b825763
2 changed files with 29 additions and 22 deletions

View File

@ -369,6 +369,7 @@ void Player::Shot()
case 5:
{
//手雷
if (curr_weapon->ammo <= 0) {
if (GetInventory(slot_id) > 0) {
DecInventory(slot_id, 1);
++curr_weapon->ammo;
@ -383,6 +384,7 @@ void Player::Shot()
}
AutoLoadingBullet();
}
}
need_sync_active_player = true;
SyncAroundPlayers();
}
@ -390,6 +392,7 @@ void Player::Shot()
case 6:
{
//烟雾弹
if (curr_weapon->ammo <= 0) {
if (GetInventory(slot_id) > 0) {
DecInventory(slot_id, 1);
++curr_weapon->ammo;
@ -404,6 +407,7 @@ void Player::Shot()
}
AutoLoadingBullet();
}
}
need_sync_active_player = true;
SyncAroundPlayers();
}

View File

@ -356,6 +356,9 @@ void Room::FillSMMapInfo(cs::SMMapInfo& map_info)
void Room::DropItem(Vector2D pos, int item_id, int item_count, int item_lv)
{
#if 0
item_id = 12301 + rand() % 2;
#endif
MetaData::Equip* equip_meta = MetaMgr::Instance()->GetEquip(item_id);
if (equip_meta && equip_meta->i->group_num() > 0 && item_count > 0) {
int total_count = item_count;