From 5aec58c788f25c465fc938d806e50d5087ab8cc3 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 12 Apr 2023 17:50:23 +0800 Subject: [PATCH] 1 --- server/gameserver/commands.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/gameserver/commands.cc b/server/gameserver/commands.cc index c12a1695..9ad0b813 100644 --- a/server/gameserver/commands.cc +++ b/server/gameserver/commands.cc @@ -121,9 +121,9 @@ void Player::_CMExecCommand(f8::MsgHdr& hdr, const cs::CMExecCommand& msg) Human* target = nullptr; room->TraverseHumanList ( - [weapon_id, &target] (Human* hum) mutable + [this, weapon_id, &target] (Human* hum) mutable { - if (hum->IsAndroid() && !hum->dead) { + if (hum->IsAndroid() && !hum->dead && hum->team_id != team_id) { if (hum->AsAndroid()->robot_meta->weapon_id() == weapon_id) { target = hum; return false;