This commit is contained in:
aozhiwei 2024-09-05 16:03:11 +08:00
parent a4cee4dfa2
commit e5e2430047

View File

@ -254,18 +254,22 @@ void Ability::RecalcAttrAddition(int attr_id)
list_head* next = nullptr;
float new_val = 0.0f;
bool inited = false;
list_for_each_safe(pos, next, head) {
AttrAddition* e = list_entry(pos,
AttrAddition,
entry);
if (IsMulCalc(attr_id)) {
if (!inited) {
new_val = 1;
inited = true;
if (attr_id == kHAT_vSpeedRateIn) {
} else {
list_for_each_safe(pos, next, head) {
AttrAddition* e = list_entry(pos,
AttrAddition,
entry);
if (IsMulCalc(attr_id)) {
if (!inited) {
new_val = 1;
inited = true;
}
new_val *= 1 + e->value;
} else {
new_val += e->value;
}
new_val *= 1 + e->value;
} else {
new_val += e->value;
}
}
if (IsValidHumanAttr(attr_id)) {