From ac398bf60f6bd707f4560429427ce7f2f64eaacb Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 29 Mar 2021 17:14:58 +0800 Subject: [PATCH] 1 --- server/gameserver/creature.cc | 14 ++++++++++++++ server/gameserver/creature.h | 2 ++ server/gameserver/human.cc | 9 --------- server/gameserver/human.h | 1 - 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index f5b219d..2a4db8b 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -893,3 +893,17 @@ void Creature::ResetAction() action_target_id = 0; need_sync_active_player = true; } + +bool Creature::IsProperTarget(Creature* target) +{ + return true; +} + +bool Creature::IsEnemy(Creature* target) +{ + if (room->GetRoomMode() == kZombieMode) { + return target->GetRace() != GetRace(); + } else { + return team_id != target->team_id; + } +} diff --git a/server/gameserver/creature.h b/server/gameserver/creature.h index 69a1e2e..5c0edce 100644 --- a/server/gameserver/creature.h +++ b/server/gameserver/creature.h @@ -57,6 +57,8 @@ class Creature : public MoveableEntity void AddPassiveSkill(int skill_id); void ClearPassiveSkill(); + bool IsProperTarget(Creature* target); + bool IsEnemy(Creature* target); virtual void SelectSkillTargets(Skill* skill, const a8::Vec2& target_pos, std::set& target_list); diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 4872988..f49d64d 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -2032,15 +2032,6 @@ void Human::WinExp(Human* sender, int exp) } } -bool Human::IsEnemy(Human* hum) -{ - if (room->GetRoomMode() == kZombieMode) { - return hum->GetRace() != GetRace(); - } else { - return team_id != hum->team_id; - } -} - RoomObstacle* Human::SummonObstacle(int id, const a8::Vec2& pos) { RoomObstacle* obstacle = room->CreateObstacle(id, pos.x, pos.y); diff --git a/server/gameserver/human.h b/server/gameserver/human.h index c39c0c1..8921cb1 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -247,7 +247,6 @@ class Human : public Creature int GetSeat() { return seat_; } void SetSeat(int seat) { seat_ = seat; } void DeadDrop(); - bool IsEnemy(Human* hum); RoomObstacle* SummonObstacle(int id, const a8::Vec2& pos); virtual std::string GetName() override { return name;};