This commit is contained in:
aozhiwei 2023-11-04 11:20:20 +08:00
parent 0fef2ada52
commit 19aa9c64db
3 changed files with 3 additions and 4 deletions

View File

@ -452,7 +452,7 @@ int Creature::TryAddBuffAndSetTime(Creature* caster,
a8::XTimerWp Creature::TryDelayAddBuff(Creature* caster,
int buff_id,
int time,
DelayAddBuffHandle* handle,
std::shared_ptr<DelayAddBuffHandle> handle,
std::shared_ptr<a8::Args> init_args,
std::shared_ptr<std::vector<float>> buff_vars)
{
@ -475,7 +475,6 @@ a8::XTimerWp Creature::TryDelayAddBuff(Creature* caster,
}
} else if (a8::TIMER_DELETE_EVENT == event) {
if (handle) {
delete handle;
}
}
},

View File

@ -181,7 +181,7 @@ class Creature : public MoveableEntity
Creature* caster,
int buff_id,
int time,
DelayAddBuffHandle* handle = nullptr,
std::shared_ptr<DelayAddBuffHandle> handle = nullptr,
std::shared_ptr<a8::Args> init_args = nullptr,
std::shared_ptr<std::vector<float>> buff_vars = nullptr
);

View File

@ -352,7 +352,7 @@ static void ProcMissile(Creature* c,
} _T;
auto context = std::make_shared<_T>();
DelayAddBuffHandle* handle = new DelayAddBuffHandle;
auto handle = std::make_shared<DelayAddBuffHandle>();
handle->pre_add_cb =
[fly_distance, context] (Creature* c)
{