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);