This commit is contained in:
aozhiwei 2023-03-28 11:18:00 +08:00
parent 5247c0f44e
commit 19dc2f68d2

View File

@ -534,6 +534,7 @@ void Ability::RecalcAttrRuduce(int attr_id)
}
list_head* pos = nullptr;
list_head* next = nullptr;
bool inited = false;
float new_val = 0.0f;
list_for_each_safe(pos, next, head) {
AttrRuduce* e = list_entry(pos,
@ -547,7 +548,12 @@ void Ability::RecalcAttrRuduce(int attr_id)
break;
case kHVAT_Dmg:
{
new_val *= 1.0f - e->value;
if (inited) {
new_val *= 1.0f - e->value;
} else {
new_val = 1.0f - e->value;
inited = true;
}
}
break;
default: