This commit is contained in:
aozhiwei 2024-01-10 12:07:39 +08:00
parent 4477bfa454
commit eef66af46d

View File

@ -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") {