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;