1
This commit is contained in:
parent
d2db33e7db
commit
145b0e76b9
@ -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<std::function<std::string()>>
|
||||
(
|
||||
[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<std::function<std::string()>>
|
||||
(
|
||||
[source_name] () -> std::string
|
||||
{
|
||||
return source_name;
|
||||
});
|
||||
owner_.Get()->GetAbility()->SetSource(attr_handle, cb);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user