From 5431630556140c6f7bafdab29d20ebd531dcf3be Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 6 Jul 2021 14:31:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BA=93=E5=AD=98=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/gameserver/creature.cc | 9 +++++++++ server/gameserver/player.cc | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index d4f08a8..6292e7d 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -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); diff --git a/server/gameserver/player.cc b/server/gameserver/player.cc index 6d7197d..6c1e5ec 100644 --- a/server/gameserver/player.cc +++ b/server/gameserver/player.cc @@ -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: