From fce35159dd996f4d333c3ce8b7e7e00af7a0f80c Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 5 Sep 2024 15:50:51 +0800 Subject: [PATCH] 1 --- server/gameserver/ability.cc | 2 ++ server/gameserver/ability.h | 1 + 2 files changed, 3 insertions(+) diff --git a/server/gameserver/ability.cc b/server/gameserver/ability.cc index 86cfd817..5adf116a 100644 --- a/server/gameserver/ability.cc +++ b/server/gameserver/ability.cc @@ -18,6 +18,7 @@ struct AttrAddition : public std::enable_shared_from_this list_head list_entry; int attr_id; float value; + int source_type = kAstNone; std::shared_ptr holder; std::shared_ptr> get_source; @@ -546,5 +547,6 @@ bool Ability::HasDecAttr(int attr_id) void Ability::SetSource(AttrHandle handle, int source_type, std::shared_ptr> cb) { auto p = handle.lock(); + p->source_type = source_type; p->get_source = cb; } diff --git a/server/gameserver/ability.h b/server/gameserver/ability.h index 3c894f52..90c9460d 100644 --- a/server/gameserver/ability.h +++ b/server/gameserver/ability.h @@ -4,6 +4,7 @@ enum AbilitySourceType_e { + kAstNone, kAstChip, kAstOther };