diff --git a/server/gameserver/commands.cc b/server/gameserver/commands.cc index 2cb38624..7cb6de9f 100644 --- a/server/gameserver/commands.cc +++ b/server/gameserver/commands.cc @@ -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); diff --git a/server/gameserver/guide.cc b/server/gameserver/guide.cc index 32305b59..e7c0921b 100644 --- a/server/gameserver/guide.cc +++ b/server/gameserver/guide.cc @@ -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> handlers;