This commit is contained in:
aozhiwei 2021-04-08 17:22:55 +08:00
parent 74bb99fccc
commit 9672339b44
2 changed files with 7 additions and 2 deletions

View File

@ -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: //烟雾弹

View File

@ -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<int, IS_END - 1>& GetInventoryData() { return inventory_; };
std::array<int, IS_END>& GetInventoryData() { return inventory_; };
virtual void _UpdateMove(int speed) {};
void CheckSpecObject();
@ -181,7 +181,7 @@ private:
float skill_distance_ = 0.0f;
std::map<int, Skill*> skill_hash_;
std::map<int, Skill*> passive_skill_hash_;
std::array<int, IS_END - 1> inventory_ = {};
std::array<int, IS_END> inventory_ = {};
friend class Skill;
};