1
This commit is contained in:
parent
49084d0a1e
commit
50cbf2f3e9
@ -482,6 +482,7 @@ void Human::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
|
|||||||
},
|
},
|
||||||
&xtimer_attacher.timer_list_
|
&xtimer_attacher.timer_list_
|
||||||
);
|
);
|
||||||
|
ClearBuffList();
|
||||||
room->frame_event.AddDead(this);
|
room->frame_event.AddDead(this);
|
||||||
room->OnHumanDie(this);
|
room->OnHumanDie(this);
|
||||||
{
|
{
|
||||||
@ -1209,6 +1210,21 @@ void Human::RemoveBuffByEffectId(int buff_effect_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Human::ClearBuffList()
|
||||||
|
{
|
||||||
|
for (auto itr = buff_list_.begin(); itr != buff_list_.end(); ++itr) {
|
||||||
|
if (buff_effect_[itr->meta->i->buff_effect()] == &(*itr)) {
|
||||||
|
buff_effect_[itr->meta->i->buff_effect()] = nullptr;
|
||||||
|
}
|
||||||
|
room->frame_event.RemoveBuff(this, itr->meta->i->buff_id());
|
||||||
|
}
|
||||||
|
buff_list_.clear();
|
||||||
|
buff_effect_ = {};
|
||||||
|
buff_attr_abs_ = {};
|
||||||
|
buff_attr_rate_ = {};
|
||||||
|
RecalcBuffAttr();
|
||||||
|
}
|
||||||
|
|
||||||
bool Human::HasBuffEffect(int buff_effect_id)
|
bool Human::HasBuffEffect(int buff_effect_id)
|
||||||
{
|
{
|
||||||
return GetBuffByEffectId(buff_effect_id) != nullptr;
|
return GetBuffByEffectId(buff_effect_id) != nullptr;
|
||||||
|
@ -186,6 +186,7 @@ class Human : public Entity
|
|||||||
void AddBuff(MetaData::Buff* buff_meta);
|
void AddBuff(MetaData::Buff* buff_meta);
|
||||||
void RemoveBuffById(int buff_id);
|
void RemoveBuffById(int buff_id);
|
||||||
void RemoveBuffByEffectId(int buff_effect_id);
|
void RemoveBuffByEffectId(int buff_effect_id);
|
||||||
|
void ClearBuffList();
|
||||||
bool HasBuffEffect(int buff_effect_id);
|
bool HasBuffEffect(int buff_effect_id);
|
||||||
Buff* GetBuffByEffectId(int effect_id);
|
Buff* GetBuffByEffectId(int effect_id);
|
||||||
void RecalcBuffAttr();
|
void RecalcBuffAttr();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user