diff --git a/server/gameserver/buff/callfunc.cc b/server/gameserver/buff/callfunc.cc index 10c9429b..80cd43fc 100644 --- a/server/gameserver/buff/callfunc.cc +++ b/server/gameserver/buff/callfunc.cc @@ -347,7 +347,7 @@ void CallFuncBuff::ProcFlashMove() void CallFuncBuff::ProcAddEnergyShield() { if (!owner->dead && !owner->downed) { - float dur_time = meta->GetBuffParam3(this) * FRAME_RATE_MS; + float dur_time = meta->GetBuffParam3(this); if (dur_time < 0.00001f) { dur_time = 99999999; } @@ -375,10 +375,11 @@ void CallFuncBuff::ProcAddEnergyShield() owner->room->xtimer.SetTimeoutWpEx ( dur_time / FRAME_RATE_MS, - [owner = owner] (int event, const a8::Args* args) mutable + [owner = owner, buff_uniid = buff_uniid] (int event, const a8::Args* args) mutable { if (a8::TIMER_DELETE_EVENT == event) { owner->ClearEnergyShield(); + owner->RemoveBuffByUniId(buff_uniid); } }, &owner->xtimer_attacher);