1
This commit is contained in:
parent
7339526263
commit
cf51132072
@ -170,6 +170,25 @@ void Player::_CMExecCommand(f8::MsgHdr* hdr, const cs::CMExecCommand& msg)
|
||||
hum->GetMutablePos().FromGlmVec3(GetPos().ToGlmVec3());
|
||||
room->grid_service->MoveCreature(hum);
|
||||
}
|
||||
} else if (cmd == "findhero" && cmds.size() >= 2) {
|
||||
int hero_id = a8::XValue(cmds[1]);
|
||||
bool found = false;
|
||||
room->TraverseHumanList
|
||||
(
|
||||
[this, hero_id, &found] (Human* hum) -> bool
|
||||
{
|
||||
if (!hum->dead && hum->GetHeroMeta()->id() == hero_id) {
|
||||
hum->GetMovement()->ClearPath();
|
||||
hum->GetMutablePos().FromGlmVec3(GetPos().ToGlmVec3());
|
||||
room->grid_service->MoveCreature(hum);
|
||||
found = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
if (!found) {
|
||||
SendDebugMsg(a8::Format("not found", {}));
|
||||
}
|
||||
} else if (cmd == "find_teammate") {
|
||||
GetTeam()->TraverseMembers
|
||||
(
|
||||
|
Loading…
x
Reference in New Issue
Block a user