From fee5dc112d190bc6f8d22ddf3d731f39767ff999 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 3 Apr 2023 14:48:49 +0800 Subject: [PATCH] 1 --- server/gameserver/ability.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/server/gameserver/ability.cc b/server/gameserver/ability.cc index dc68ce30..f5c923b5 100644 --- a/server/gameserver/ability.cc +++ b/server/gameserver/ability.cc @@ -400,7 +400,11 @@ void Ability::RecalcAttrAddition(int attr_id) entry); new_val += e->value; } - std::get<0>(attr_add_[attr_id]) = new_val; + if (IsValidHumanAttr(attr_id)) { + std::get<0>(attr_add_[attr_id]) = new_val; + } else if (IsValidHumanVirtualAttr(attr_id)) { + std::get<0>(vattr_add_[attr_id - kHVAT_Begin]) = new_val; + } } void Ability::RecalcAttrRuduce(int attr_id) @@ -444,7 +448,11 @@ void Ability::RecalcAttrRuduce(int attr_id) break; } } - std::get<0>(attr_dec_[attr_id]) = new_val; + if (IsValidHumanAttr(attr_id)) { + std::get<0>(attr_dec_[attr_id]) = new_val; + } else if (IsValidHumanVirtualAttr(attr_id)) { + std::get<0>(vattr_dec_[attr_id - kHVAT_Begin]) = new_val; + } } float Ability::GetAttrAddition(int attr_id)