1
This commit is contained in:
parent
38e8a7b4e8
commit
a5d5be071e
@ -186,6 +186,24 @@ void Creature::AddBuff(Creature* caster,
|
||||
int skill_lv,
|
||||
MetaData::Skill* buff_skill_meta)
|
||||
{
|
||||
if (buff_meta->i->buff_interval() > 0) {
|
||||
if (buff_interval_hash_.find(buff_meta->i->buff_id()) != buff_interval_hash_.end()) {
|
||||
return;
|
||||
}
|
||||
buff_interval_hash_[buff_meta->i->buff_id()] = room->GetFrameNo();
|
||||
room->xtimer.AddDeadLineTimerAndAttach
|
||||
(
|
||||
buff_meta->i->buff_interval() / FRAME_RATE_MS,
|
||||
a8::XParams()
|
||||
.SetSender(this)
|
||||
.SetParam1(buff_meta->i->buff_id()),
|
||||
[] (const a8::XParams& param)
|
||||
{
|
||||
Creature* c = (Creature*)param.sender.GetUserData();
|
||||
c->buff_interval_hash_.erase(param.param1);
|
||||
},
|
||||
&xtimer_attacher.timer_list_);
|
||||
}
|
||||
if (buff_meta->i->coexist_num() > 0){
|
||||
if (GetBuffNum(buff_meta->i->buff_id()) >= buff_meta->i->coexist_num()) {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user