diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index 2fca5bb7..06769288 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -1189,6 +1189,11 @@ void Creature::Shot(a8::Vec2& target_dir, bool& shot_ok, float fly_distance) --curr_weapon->ammo; } int slot_id = curr_weapon->meta->i->_inventory_slot(); + #ifdef DEBUG + if (IsPlayer()) { + SendDebugMsg(a8::Format("使用武器 %s slot:%d", {curr_weapon->meta->i->name(), slot_id})); + } + #endif switch (slot_id) { case IS_FRAG: //手雷 case IS_SMOKE: //烟雾弹 diff --git a/server/gameserver/creature.h b/server/gameserver/creature.h index 8a1df79d..bc11340e 100644 --- a/server/gameserver/creature.h +++ b/server/gameserver/creature.h @@ -126,7 +126,7 @@ class Creature : public MoveableEntity int GetInventory(int slot_id); void AddInventory(int slot_id, int num); void DecInventory(int slot_id, int num); - std::array& GetInventoryData() { return inventory_; }; + std::array& GetInventoryData() { return inventory_; }; virtual void _UpdateMove(int speed) {}; void CheckSpecObject(); @@ -181,7 +181,7 @@ private: float skill_distance_ = 0.0f; std::map skill_hash_; std::map passive_skill_hash_; - std::array inventory_ = {}; + std::array inventory_ = {}; friend class Skill; };