This commit is contained in:
aozhiwei 2023-11-09 15:18:52 +08:00
parent 4146e07c3c
commit c2448528a1

View File

@ -12,6 +12,7 @@
#include "car.h" #include "car.h"
#include "incubator.h" #include "incubator.h"
#include "mapinstance.h" #include "mapinstance.h"
#include "team.h"
#include "cs_proto.pb.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()); hum->GetMutablePos().FromGlmVec3(GetPos().ToGlmVec3());
room->grid_service->MoveCreature(hum); 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) { } else if (cmd == "randomobj" && cmds.size() >= 2) {
int weapon_id = a8::XValue(cmds[1]); int weapon_id = a8::XValue(cmds[1]);
Human* target = nullptr; Human* target = nullptr;