From e626d40b0ba3bb52b933c1287d638ee187af1a3f Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 28 Mar 2023 16:14:42 +0800 Subject: [PATCH] 1 --- server/gameserver/buff/modify_grow_attr.cc | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/server/gameserver/buff/modify_grow_attr.cc b/server/gameserver/buff/modify_grow_attr.cc index 78531994..c248655a 100644 --- a/server/gameserver/buff/modify_grow_attr.cc +++ b/server/gameserver/buff/modify_grow_attr.cc @@ -10,9 +10,34 @@ void ModifyGrowAttrBuff::Activate() { + int attr_id = meta->_int_buff_param1; + if (IsValidHumanAttr(attr_id)) { + float value = meta->GetBuffParam2(this); + switch (meta->_int_buff_param3) { + case 1: + { + owner->GetAbility()->AddAttrAddition(attr_id, value); + } + break; + case 2: + { + owner->GetAbility()->AddAttrRuduce(attr_id, value); + } + break; + default: + { + } + break; + } + } } void ModifyGrowAttrBuff::Deactivate() { - + if (!add_handle_.expired()) { + owner->GetAbility()->RemoveAttrAddition(add_handle_); + } + if (!ruduce_handle_.expired()) { + owner->GetAbility()->RemoveAttrRuduce(ruduce_handle_); + } }