From 8dc0473d4ddf67b4e2cb9835059bd081f97f4be5 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 19 Jul 2021 11:33:44 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A3=81=E5=9E=92=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/gameserver/creature.h | 1 + server/gameserver/entity.h | 1 + server/gameserver/explosion.cc | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/server/gameserver/creature.h b/server/gameserver/creature.h index 50046ae..9218d77 100644 --- a/server/gameserver/creature.h +++ b/server/gameserver/creature.h @@ -89,6 +89,7 @@ class Creature : public MoveableEntity virtual void RemoveOutObjects(Entity* entity) {}; virtual bool Attackable(Room* room) override; virtual bool ReceiveExplosionDmg(Explosion* explosion) override; + virtual bool IsCreature(Room* room) override { return true;}; bool HasBuffEffect(int buff_effect_id); Buff* GetBuffByEffectId(int effect_id); Buff* GetBuffById(int buff_id); diff --git a/server/gameserver/entity.h b/server/gameserver/entity.h index 2b16784..afcc601 100644 --- a/server/gameserver/entity.h +++ b/server/gameserver/entity.h @@ -30,6 +30,7 @@ class Entity virtual float GetHitRadius() { return GetRadius();}; virtual void GetCircleBox(CircleCollider& circle_box); virtual bool IsDead(Room* room) { return false;}; + virtual bool IsCreature(Room* room) { return false;}; virtual long long GetDeadFrameNo(Room* room) { return 0;}; virtual void OnPreCollision(Room* room) {}; virtual void RecalcSelfCollider() {}; diff --git a/server/gameserver/explosion.cc b/server/gameserver/explosion.cc index 19a17b0..7f181c0 100644 --- a/server/gameserver/explosion.cc +++ b/server/gameserver/explosion.cc @@ -116,7 +116,7 @@ void Explosion::InternalAttack() } ); for (auto& target : objects) { - if (target->HasBuffEffect(kBET_BulletThrough)) { + if (target->IsCreature(room_) && ((Creature*)target)->HasBuffEffect(kBET_BulletThrough)) { continue; } target->OnExplosionHit(this);