1
This commit is contained in:
parent
e00e72d0a7
commit
488a08737f
@ -142,7 +142,7 @@ void Explosion::InternalAttack()
|
||||
if (explosion_damage_delay_ <= 0) {
|
||||
ProcDamage();
|
||||
} else {
|
||||
std::shared_ptr<Explosion>* self = new std::shared_ptr<Explosion>();
|
||||
auto self = new std::shared_ptr<Explosion>();
|
||||
*self = shared_from_this();
|
||||
room_->xtimer.AddDeadLineTimerAndAttach
|
||||
(explosion_damage_delay_ / FRAME_RATE_MS,
|
||||
@ -150,13 +150,13 @@ void Explosion::InternalAttack()
|
||||
.SetSender(self),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
auto* self = (std::shared_ptr<Explosion>*)param.sender.GetUserData();
|
||||
auto self = (std::shared_ptr<Explosion>*)param.sender.GetUserData();
|
||||
(*self)->ProcDamage();
|
||||
},
|
||||
&room_->xtimer_attacher_.timer_list_,
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
auto* self = (std::shared_ptr<Explosion>*)param.sender.GetUserData();
|
||||
auto self = (std::shared_ptr<Explosion>*)param.sender.GetUserData();
|
||||
delete self;
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user