From 338f483f6087770af48cb79b562936cf2a8b0d52 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 14 Jul 2020 15:35:19 +0800 Subject: [PATCH] 1 --- server/gameserver/human.cc | 3 +++ server/gameserver/human.h | 1 + 2 files changed, 4 insertions(+) diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index e120661..1f66e7e 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -761,6 +761,9 @@ void Human::AutoLoadingBullet(bool manual) bullet_meta->i->_inventory_slot() < (int)inventory_.size() ) { if (GetInventory(bullet_meta->i->_inventory_slot()) > 0) { + if (on_loading_bullet) { + on_loading_bullet(); + } StartAction(AT_Reload, curr_weapon->meta->i->reload_time(), curr_weapon->weapon_id, diff --git a/server/gameserver/human.h b/server/gameserver/human.h index fcbadca..9f44643 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -53,6 +53,7 @@ class Human : public MoveableEntity a8::Vec2 move_dir; a8::Vec2 attack_dir; + std::function on_loading_bullet; std::string name; std::string avatar_url;