diff --git a/server/gameserver/commands.cc b/server/gameserver/commands.cc index b0c5572d..e3d34b4f 100644 --- a/server/gameserver/commands.cc +++ b/server/gameserver/commands.cc @@ -12,6 +12,7 @@ #include "car.h" #include "incubator.h" #include "mapinstance.h" +#include "team.h" #include "cs_proto.pb.h" @@ -149,6 +150,17 @@ void Player::_CMExecCommand(f8::MsgHdr& hdr, const cs::CMExecCommand& msg) hum->GetMutablePos().FromGlmVec3(GetPos().ToGlmVec3()); room->grid_service->MoveCreature(hum); } + } else if (cmd == "find_teammate") { + GetTeam()->TraverseMembers + ( + [this] (Human* hum) -> bool + { + a8::SetBitFlag(hum->status, CS_NoDie); + hum->GetMovement()->ClearPath(); + hum->GetMutablePos().FromGlmVec3(GetPos().ToGlmVec3()); + room->grid_service->MoveCreature(hum); + return true; + }); } else if (cmd == "randomobj" && cmds.size() >= 2) { int weapon_id = a8::XValue(cmds[1]); Human* target = nullptr;