This commit is contained in:
aozhiwei 2023-04-20 17:19:47 +08:00
parent e1c8383316
commit fd8f56d971
2 changed files with 16 additions and 7 deletions

View File

@ -30,6 +30,12 @@ void Player::_CMExecCommand(f8::MsgHdr& hdr, const cs::CMExecCommand& msg)
std::string cmd = cmds[0];
if (cmd == "gps") {
SendDebugMsg(a8::Format("gps: %f,%f,%f", {GetPos().GetX(), GetPos().GetY(), GetPos().GetZ()}));
} else if (cmd == "goto" && cmds.size() >= 3) {
float x = a8::XValue(cmds[1]).GetDouble();
float y = a8::XValue(cmds[2]).GetDouble();
float z = a8::XValue(cmds[3]).GetDouble();
GetMutablePos().FromGlmVec3(glm::vec3(x, y, z));
room->grid_service->MoveCreature(this);
} else if (cmd == "setmode") {
if (cmds.empty()) {
App::Instance()->UnSetFlag(20);

View File

@ -28,6 +28,14 @@ void Guide::Init(Human* owner)
void Guide::UpdateStep()
{
curr_step_meta_ = mt::GuideStep::_steps.at(curr_step_idx_);
#ifdef DEBUG
a8::XPrintf("UpdateStep idx:%d id:%d target:%d\n",
{
curr_step_idx_,
curr_step_meta_->id(),
curr_step_meta_->target()
});
#endif
owner_->room->frame_event.AddPropChg
(
owner_->GetWeakPtrRef(),
@ -178,7 +186,6 @@ void Guide::ProcKillEnemy()
if (!hero_meta){
continue;
}
++i;
context->heros.push_back(-1);
owner_->room->xtimer.SetTimeoutEx
(
@ -199,6 +206,7 @@ void Guide::ProcKillEnemy()
}
},
&owner_->xtimer_attacher);
++i;
}
}
@ -254,7 +262,6 @@ void Guide::ProcUseSkillAndKillEnemy()
if (!hero_meta){
continue;
}
++i;
context->heros.push_back(-1);
owner_->room->xtimer.SetTimeoutEx
(
@ -275,6 +282,7 @@ void Guide::ProcUseSkillAndKillEnemy()
}
},
&owner_->xtimer_attacher);
++i;
}
}
@ -309,11 +317,6 @@ void Guide::ProcUseSkillAndKillEnemy()
void Guide::ProcUseSkill()
{
if (curr_step_meta_->_params.empty()) {
NextStep();
return;
}
auto context = A8_MAKE_ANON_STRUCT_SHARED
(
std::vector<std::weak_ptr<EventHandlerPtr>> handlers;