This commit is contained in:
aozhiwei 2021-09-18 13:52:41 +08:00
parent c1e6dba2f7
commit e00e72d0a7

View File

@ -72,6 +72,9 @@ void Explosion::ProcDamage()
grid_list, grid_list,
[this, &objects] (Creature* c, bool& stop) [this, &objects] (Creature* c, bool& stop)
{ {
if (c->dead) {
return;
}
if (c->GetUniId() == exclude_uniid) { if (c->GetUniId() == exclude_uniid) {
return; return;
} }
@ -147,13 +150,13 @@ void Explosion::InternalAttack()
.SetSender(self), .SetSender(self),
[] (const a8::XParams& param) [] (const a8::XParams& param)
{ {
std::shared_ptr<Explosion>* self = (std::shared_ptr<Explosion>*)param.sender.GetUserData(); auto* self = (std::shared_ptr<Explosion>*)param.sender.GetUserData();
(*self)->ProcDamage(); (*self)->ProcDamage();
}, },
&room_->xtimer_attacher_.timer_list_, &room_->xtimer_attacher_.timer_list_,
[] (const a8::XParams& param) [] (const a8::XParams& param)
{ {
std::shared_ptr<Explosion>* self = (std::shared_ptr<Explosion>*)param.sender.GetUserData(); auto* self = (std::shared_ptr<Explosion>*)param.sender.GetUserData();
delete self; delete self;
}); });
} }
@ -161,7 +164,8 @@ void Explosion::InternalAttack()
bool Explosion::IsPreBattleExplosion() bool Explosion::IsPreBattleExplosion()
{ {
return create_frameno_ <= room_->GetBattleStartFrameNo() || room_->GetBattleStartFrameNo() == 0; return create_frameno_ <= room_->GetBattleStartFrameNo() ||
room_->GetBattleStartFrameNo() == 0;
} }
void Explosion::AddForceTarget(CreatureWeakPtr force_target) void Explosion::AddForceTarget(CreatureWeakPtr force_target)