From 2accc6d37050d95c4c52fd92cfb1157a3ffc60a8 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 4 Jan 2024 15:21:40 +0800 Subject: [PATCH] 1 --- server/gameserver/mt/Buff.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/server/gameserver/mt/Buff.cc b/server/gameserver/mt/Buff.cc index a0a6f223..50923f68 100644 --- a/server/gameserver/mt/Buff.cc +++ b/server/gameserver/mt/Buff.cc @@ -11,6 +11,16 @@ IMPL_TABLE(mt::Buff) static std::map> attr_buffs; +static void AddCheckAttrBuff(int attr_id, mt::Buff* buff_meta) +{ + auto itr = attr_buffs.find(attr_id); + if (itr == attr_buffs.end()) { + attr_buffs[attr_id] = std::vector({buff_meta}); + } else { + itr->second.push_back(buff_meta); + } +} + namespace mt { @@ -340,12 +350,11 @@ namespace mt switch (buff_effect()) { case kBET_ModifyAttr: { - } break; case kBET_OnceChgAttr: { - + AddCheckAttrBuff(_int_buff_param1, this); } break; case kBET_ModifyBaseAttr: