From c4c1f338658eb3c97de0d0d7493401483941a1af Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 23 Mar 2021 16:55:22 +0800 Subject: [PATCH] 1 --- server/gameserver/creature.h | 1 + server/gameserver/human.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/server/gameserver/creature.h b/server/gameserver/creature.h index e53264a..1f1143b 100644 --- a/server/gameserver/creature.h +++ b/server/gameserver/creature.h @@ -73,6 +73,7 @@ class Creature : public MoveableEntity virtual void DropItems(Obstacle* obstacle) {}; virtual bool IsPlayer() const { return false;}; virtual bool IsAndroid() const { return false;}; + virtual void DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id) {}; RaceType_e GetRace() { return race_; } float GetAttrAbs(int attr_id); diff --git a/server/gameserver/human.h b/server/gameserver/human.h index badb66d..bc33811 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -173,7 +173,7 @@ class Human : public Creature virtual void CancelAction() override; virtual void ResetAction() override; void BeKill(int killer_id, const std::string& killer_name, int weapon_id); - void DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id); + virtual void DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id) override; void AddToNewObjects(Entity* entity); void AddToPartObjects(Entity* entity); void RemovePartObjects(Entity* entity);