diff --git a/server/gameserver/commands.cc b/server/gameserver/commands.cc index 9bafd81b..0f6de921 100644 --- a/server/gameserver/commands.cc +++ b/server/gameserver/commands.cc @@ -233,11 +233,20 @@ void Player::_CMExecCommand(f8::MsgHdr* hdr, const cs::CMExecCommand& msg) int attr_id = a8::XValue(cmds[2]); float value = a8::XValue(cmds[3]).GetDouble(); if (target) { - target->GetAbility()->AddAttr(attr_id, value); + auto handle = target->GetAbility()->AddAttr(attr_id, value); std::vector strings = target->GetAbility()->GMShowAttrs(); for (auto& str : strings) { SendDebugMsg("数值: " + str); } + if (!handle.expired()) { + auto cb = std::make_shared> + ( + [] () -> std::string + { + return ""; + }); + target->GetAbility()->SetSource(handle, cb); + } } } } else if (cmd == "del_attr") {