diff --git a/server/gameserver/ability.cc b/server/gameserver/ability.cc index e4b07b69..8006358e 100644 --- a/server/gameserver/ability.cc +++ b/server/gameserver/ability.cc @@ -19,6 +19,7 @@ struct AttrAddition : public std::enable_shared_from_this int attr_id; float value; std::shared_ptr holder; + std::shared_ptr> get_source; AttrAddition(int attr_id, float value) { @@ -396,7 +397,11 @@ std::vector Ability::GMShowAttrs() AttrAddition* e = list_entry(pos, AttrAddition, list_entry); - data += "" + a8::XValue(e->value).GetString() + ","; + if (e->get_source) { + data += "" + a8::XValue(e->value).GetString() + (*e->get_source)() + ","; + } else { + data += "" + a8::XValue(e->value).GetString() + "<-none,"; + } ++i; } if (i > 0) { @@ -531,3 +536,9 @@ bool Ability::HasDecAttr(int attr_id) } return false; } + + +void Ability::SetSource(AttrHandle handle, std::shared_ptr> cb) +{ + +} diff --git a/server/gameserver/ability.h b/server/gameserver/ability.h index 067c4092..22788a68 100644 --- a/server/gameserver/ability.h +++ b/server/gameserver/ability.h @@ -29,6 +29,7 @@ class Ability void GMDelAttr(int attr_id, int idx); void GMClearAttr(); std::vector GMShowAttrs(); + void SetSource(AttrHandle handle, std::shared_ptr> cb); private: void Clear();