This commit is contained in:
aozhiwei 2024-05-15 15:14:40 +08:00
parent 2a89cc3d84
commit ee70076369

View File

@ -1150,7 +1150,7 @@ void Creature::Initialize()
for (auto& node : cond_buffs_) { for (auto& node : cond_buffs_) {
INIT_LIST_HEAD(&node); INIT_LIST_HEAD(&node);
} }
if (IsHuman() && mt::Param::s().nature_recover_hp_switch) { if (IsHuman()) {
a8::XTimerWp nature_recover_hp_timer; a8::XTimerWp nature_recover_hp_timer;
nature_recover_hp_idle_timer = room->xtimer.SetIntervalWpEx nature_recover_hp_idle_timer = room->xtimer.SetIntervalWpEx
( (
@ -1165,7 +1165,8 @@ void Creature::Initialize()
[this] (int event, const a8::Args* args) mutable [this] (int event, const a8::Args* args) mutable
{ {
if (a8::TIMER_EXEC_EVENT == event) { if (a8::TIMER_EXEC_EVENT == event) {
if (!dead && !poisoning && !downed && !HasBuffEffect(kBET_Dive)) { if (!dead && !poisoning && !downed && !HasBuffEffect(kBET_Dive) &&
mt::Param::s().nature_recover_hp_switch) {
if (GetHP() + 1 < GetMaxHP()) { if (GetHP() + 1 < GetMaxHP()) {
AddHp(GetMaxHP() * mt::Param::s().nature_recover_hp_rate); AddHp(GetMaxHP() * mt::Param::s().nature_recover_hp_rate);
TryAddBuff(this, kRecoverHpEffectBuffId); TryAddBuff(this, kRecoverHpEffectBuffId);