1
This commit is contained in:
parent
4477bfa454
commit
eef66af46d
@ -233,11 +233,20 @@ void Player::_CMExecCommand(f8::MsgHdr* hdr, const cs::CMExecCommand& msg)
|
|||||||
int attr_id = a8::XValue(cmds[2]);
|
int attr_id = a8::XValue(cmds[2]);
|
||||||
float value = a8::XValue(cmds[3]).GetDouble();
|
float value = a8::XValue(cmds[3]).GetDouble();
|
||||||
if (target) {
|
if (target) {
|
||||||
target->GetAbility()->AddAttr(attr_id, value);
|
auto handle = target->GetAbility()->AddAttr(attr_id, value);
|
||||||
std::vector<std::string> strings = target->GetAbility()->GMShowAttrs();
|
std::vector<std::string> strings = target->GetAbility()->GMShowAttrs();
|
||||||
for (auto& str : strings) {
|
for (auto& str : strings) {
|
||||||
SendDebugMsg("数值: " + str);
|
SendDebugMsg("数值: " + str);
|
||||||
}
|
}
|
||||||
|
if (!handle.expired()) {
|
||||||
|
auto cb = std::make_shared<std::function<std::string()>>
|
||||||
|
(
|
||||||
|
[] () -> std::string
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
});
|
||||||
|
target->GetAbility()->SetSource(handle, cb);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (cmd == "del_attr") {
|
} else if (cmd == "del_attr") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user