修复手榴弹问题
This commit is contained in:
parent
72def7cf5e
commit
173b825763
@ -369,19 +369,21 @@ void Player::Shot()
|
||||
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];
|
||||
if (curr_weapon->ammo <= 0) {
|
||||
if (GetInventory(slot_id) > 0) {
|
||||
DecInventory(slot_id, 1);
|
||||
++curr_weapon->ammo;
|
||||
} else {
|
||||
curr_weapon = &weapons[0];
|
||||
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();
|
||||
}
|
||||
AutoLoadingBullet();
|
||||
}
|
||||
need_sync_active_player = true;
|
||||
SyncAroundPlayers();
|
||||
@ -390,19 +392,21 @@ void Player::Shot()
|
||||
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];
|
||||
if (curr_weapon->ammo <= 0) {
|
||||
if (GetInventory(slot_id) > 0) {
|
||||
DecInventory(slot_id, 1);
|
||||
++curr_weapon->ammo;
|
||||
} else {
|
||||
curr_weapon = &weapons[0];
|
||||
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();
|
||||
}
|
||||
AutoLoadingBullet();
|
||||
}
|
||||
need_sync_active_player = true;
|
||||
SyncAroundPlayers();
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user