This commit is contained in:
aozhiwei 2021-06-25 21:48:51 +08:00
parent 3c108eadad
commit 8252c6a63c
3 changed files with 8 additions and 0 deletions

View File

@ -73,6 +73,9 @@ void Explosion::InternalAttack()
grid_list,
[this, &objects] (Creature* c, bool& stop)
{
if (c->GetUniId() == exclude_uniid) {
return;
}
if (!c->Attackable(room_)) {
return;
}
@ -98,6 +101,9 @@ void Explosion::InternalAttack()
grid_list,
[this, &objects] (Entity* entity, bool& stop)
{
if (entity->GetUniId() == exclude_uniid) {
return;
}
if (!entity->Attackable(room_)) {
return;
}

View File

@ -6,6 +6,7 @@ class Room;
class Explosion
{
public:
int exclude_uniid = 0;
Room* GetRoom() { return room_; };
CreatureWeakPtr GetSender() { return sender_; };

View File

@ -185,6 +185,7 @@ void RoomObstacle::SpecExplosion()
a8::Vec2 bomb_pos = GetPos() + bomb_born_offset;
if (room->grid_service->CanAdd(bomb_pos.x, bomb_pos.y)) {
Explosion explosion;
explosion.exclude_uniid = GetUniId();
explosion.IndifferenceAttack(
room,
bomb_pos,