diff --git a/server/gameserver/netdata.cc b/server/gameserver/netdata.cc index 9d16b5ec..ed5c4653 100644 --- a/server/gameserver/netdata.cc +++ b/server/gameserver/netdata.cc @@ -287,6 +287,24 @@ private: if (attr && attr->IsObject()) { int attr_id = a8::XValue(attr->Get("attr_id", "0")); float val = a8::XValue(attr->Get("val", "0")).GetDouble(); + if (IsValidHumanAttr(attr_id)) { + auto attr_handle = owner_.Get()->GetAbility()->AddAttr(attr_id, val); + if (!attr_handle.expired()) { +#ifdef MYDEBUG + std::string source_name = a8::Format + ("<-hero_rand_attr", + { + }); + auto cb = std::make_shared> + ( + [source_name] () -> std::string + { + return source_name; + }); + owner_.Get()->GetAbility()->SetSource(attr_handle, cb); + } +#endif + } } } } @@ -301,6 +319,24 @@ private: if (attr && attr->IsObject()) { int attr_id = a8::XValue(attr->Get("attr_id", "0")); float val = a8::XValue(attr->Get("val", "0")).GetDouble(); + if (IsValidHumanAttr(attr_id)) { + auto attr_handle = owner_.Get()->GetAbility()->AddAttr(attr_id, val); + if (!attr_handle.expired()) { +#ifdef MYDEBUG + std::string source_name = a8::Format + ("<-chip_page", + { + }); + auto cb = std::make_shared> + ( + [source_name] () -> std::string + { + return source_name; + }); + owner_.Get()->GetAbility()->SetSource(attr_handle, cb); + } +#endif + } } } }