From 72dad82547d08c7b5b452f7bc5caec6009baac66 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 5 Sep 2024 17:47:45 +0800 Subject: [PATCH] 1 --- server/gameserver/commands.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/gameserver/commands.cc b/server/gameserver/commands.cc index df209df9..598b2161 100644 --- a/server/gameserver/commands.cc +++ b/server/gameserver/commands.cc @@ -337,6 +337,7 @@ void Player::_CMExecCommand(f8::MsgHdr* hdr, const cs::CMExecCommand& msg) room->GetCreatureByUniId(a8::XValue(cmds[1]).GetInt()); int attr_id = a8::XValue(cmds[2]); float value = a8::XValue(cmds[3]).GetDouble(); + int source_type = cmds.size() > 4 ? a8::XValue(cmds[4]).GetInt() : kAstOther; if (target) { auto handle = target->GetAbility()->AddAttr(attr_id, value); std::vector strings = target->GetAbility()->GMShowAttrs(); @@ -351,7 +352,7 @@ void Player::_CMExecCommand(f8::MsgHdr* hdr, const cs::CMExecCommand& msg) { return source_name; }); - target->GetAbility()->SetSource(handle, kAstOther, cb); + target->GetAbility()->SetSource(handle, source_type, cb); } } }