1
This commit is contained in:
parent
250c19a1b1
commit
a443e3ea92
@ -31,7 +31,7 @@ Buff::Buff()
|
|||||||
|
|
||||||
Buff::~Buff()
|
Buff::~Buff()
|
||||||
{
|
{
|
||||||
|
int i = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Buff::Init()
|
void Buff::Init()
|
||||||
|
@ -219,11 +219,17 @@ int Creature::AddBuff(Creature* caster,
|
|||||||
buff->remover_timer = room->xtimer.SetTimeoutWpEx
|
buff->remover_timer = room->xtimer.SetTimeoutWpEx
|
||||||
(
|
(
|
||||||
buff_meta->duration_time() * SERVER_FRAME_RATE,
|
buff_meta->duration_time() * SERVER_FRAME_RATE,
|
||||||
[buff] (int event, const a8::Args* args)
|
[buff_wp = (std::weak_ptr<Buff>)buff] (int event, const a8::Args* args)
|
||||||
{
|
{
|
||||||
if (a8::TIMER_EXEC_EVENT == event) {
|
if (a8::TIMER_EXEC_EVENT == event) {
|
||||||
|
if (!buff_wp.expired()) {
|
||||||
|
Buff* buff = nullptr;
|
||||||
|
{
|
||||||
|
buff = buff_wp.lock().get();
|
||||||
|
}
|
||||||
buff->owner->RemoveBuffByUniId(buff->buff_uniid);
|
buff->owner->RemoveBuffByUniId(buff->buff_uniid);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
&buff->xtimer_attacher);
|
&buff->xtimer_attacher);
|
||||||
}
|
}
|
||||||
@ -408,6 +414,9 @@ void Creature::RemoveBuffByUniId(int buff_uniid)
|
|||||||
OnBuffRemove(*buff.get());
|
OnBuffRemove(*buff.get());
|
||||||
buff->UnInit();
|
buff->UnInit();
|
||||||
buff_list_.erase(itr);
|
buff_list_.erase(itr);
|
||||||
|
if (buff.use_count() > 1) {
|
||||||
|
abort();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
third_party/a8
vendored
2
third_party/a8
vendored
@ -1 +1 @@
|
|||||||
Subproject commit dfc2c950b9ff2fd0c839034b4f173b3b22fc329e
|
Subproject commit c72553f5429074e2c74316f81e660236fc4c2fd8
|
Loading…
x
Reference in New Issue
Block a user