修复库存问题
This commit is contained in:
parent
e9133812d4
commit
5431630556
@ -1343,6 +1343,9 @@ void Creature::Shot(a8::Vec2& target_dir, bool& shot_ok, float fly_distance)
|
||||
case IS_FRAG: //手雷
|
||||
case IS_SMOKE: //烟雾弹
|
||||
{
|
||||
#if 1
|
||||
DecInventory(slot_id, 1);
|
||||
#endif
|
||||
if (GetCurrWeapon()->ammo <= 0) {
|
||||
if (GetInventory(slot_id) > 0) {
|
||||
DecInventory(slot_id, 1);
|
||||
@ -1371,6 +1374,9 @@ void Creature::Shot(a8::Vec2& target_dir, bool& shot_ok, float fly_distance)
|
||||
case IS_TRAP: //陷井
|
||||
case IS_MINE: //地雷
|
||||
{
|
||||
#if 1
|
||||
DecInventory(slot_id, 1);
|
||||
#endif
|
||||
if (GetCurrWeapon()->ammo <= 0) {
|
||||
if (GetInventory(slot_id) > 0) {
|
||||
DecInventory(slot_id, 1);
|
||||
@ -1399,6 +1405,9 @@ void Creature::Shot(a8::Vec2& target_dir, bool& shot_ok, float fly_distance)
|
||||
case IS_SINGAL_GUN:
|
||||
case IS_OIL_BUCKET:
|
||||
{
|
||||
#if 1
|
||||
DecInventory(slot_id, 1);
|
||||
#endif
|
||||
if (GetCurrWeapon()->ammo <= 0) {
|
||||
if (GetInventory(slot_id) > 0) {
|
||||
DecInventory(slot_id, 1);
|
||||
|
@ -629,7 +629,9 @@ void Player::LootInteraction(Loot* entity)
|
||||
weapon->ammo += entity->count;
|
||||
weapon->meta = item_meta;
|
||||
weapon->Recalc();
|
||||
#if 0
|
||||
DecInventory(item_meta->i->_inventory_slot(), add_num);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case IS_1XSCOPE:
|
||||
@ -656,7 +658,9 @@ void Player::LootInteraction(Loot* entity)
|
||||
weapon->ammo += entity->count;
|
||||
weapon->meta = item_meta;
|
||||
weapon->Recalc();
|
||||
#if 0
|
||||
DecInventory(item_meta->i->_inventory_slot(), add_num);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case IS_C4:
|
||||
@ -672,7 +676,9 @@ void Player::LootInteraction(Loot* entity)
|
||||
weapon->ammo += entity->count;
|
||||
weapon->meta = item_meta;
|
||||
weapon->Recalc();
|
||||
#if 0
|
||||
DecInventory(item_meta->i->_inventory_slot(), add_num);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user