diff --git a/server/gameserver/attrhelper.cc b/server/gameserver/attrhelper.cc index b00993f6..34d709ee 100644 --- a/server/gameserver/attrhelper.cc +++ b/server/gameserver/attrhelper.cc @@ -23,5 +23,27 @@ bool AttrHelper::ParseAttr(std::shared_ptr xobj, std::array& attr_abs, std::array& attr_rate) { + if (xobj->IsArray()) { + for (int i = 0; i < xobj->Size(); ++i) { + std::shared_ptr obj = xobj->At(i); + if (obj->IsObject()) { + int attr_id = obj->Get("attr_id", 0); + int type = obj->Get("type", 0); + int val = obj->Get("val", 0); + { + float* p = GetAttrAbsPtr(attr_abs, attr_id); + if (p) { + *p = val; + } + } + { + float* p = GetAttrRatePtr(attr_rate, attr_id); + if (p) { + *p = val; + } + } + } + } + } return true; }