From 0afe5814ea8a76ec56e80a4c1a5a77028164de9e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 23 Mar 2023 11:12:39 +0800 Subject: [PATCH] 1 --- server/gameserver/buff/summon_loot.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/server/gameserver/buff/summon_loot.cc b/server/gameserver/buff/summon_loot.cc index 13796330..03af935f 100644 --- a/server/gameserver/buff/summon_loot.cc +++ b/server/gameserver/buff/summon_loot.cc @@ -35,6 +35,18 @@ void SummonLootBuff::Activate() loot->skill_meta = skill_meta; loot->buff_vars = buff_vars; loot->master = owner->GetWeakPtrRef(); + + owner->room->xtimer.SetTimeoutWpEx + ( + show_time * SERVER_FRAME_RATE, + [loot] (int event, const a8::Args* args) mutable + { + if (a8::TIMER_EXEC_EVENT == event) { + loot->room->RemoveObjectLater(loot); + } + }, + &loot->xtimer_attacher); + } } }