1
This commit is contained in:
parent
563f936d44
commit
d2db33e7db
@ -279,6 +279,32 @@ private:
|
|||||||
|
|
||||||
void DtoInit(Creature* c)
|
void DtoInit(Creature* c)
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
auto rand_attr = hero_dto->At("rand_attr");
|
||||||
|
if (rand_attr && rand_attr->IsArray()) {
|
||||||
|
for (int i = 0; i < rand_attr->Size(); ++i) {
|
||||||
|
auto attr = rand_attr->At(i);
|
||||||
|
if (attr && attr->IsObject()) {
|
||||||
|
int attr_id = a8::XValue(attr->Get("attr_id", "0"));
|
||||||
|
float val = a8::XValue(attr->Get("val", "0")).GetDouble();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
auto chip_page = hero_dto->At("chip_page");
|
||||||
|
if (chip_page && chip_page->IsObject()) {
|
||||||
|
std::vector<std::string> keys;
|
||||||
|
chip_page->GetKeys(keys);
|
||||||
|
for (auto& key : keys) {
|
||||||
|
auto attr = chip_page->At(key);
|
||||||
|
if (attr && attr->IsObject()) {
|
||||||
|
int attr_id = a8::XValue(attr->Get("attr_id", "0"));
|
||||||
|
float val = a8::XValue(attr->Get("val", "0")).GetDouble();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user