diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 81f84027..390b92b5 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -1532,23 +1532,28 @@ void Room::UpdateGasInactiveMoba() battle_start_frameno_ = GetFrameNo(); #if 1 App::Instance()->verify_set_pos = 1; - for (auto& pair : human_hash_) { - Human* hum = pair.second; - if (!hum->GetBornPoint()) { - abort(); - } else { - hum->SetPos(hum->GetBornPoint()->RandPoint(this)); - } - a8::XPrintf("set_pos side:%d %d pos:%f %f %f\n", { - hum->side, - hum->GetUniId(), - hum->GetPos().GetX(), - hum->GetPos().GetY(), - hum->GetPos().GetZ(), - }); - hum->GetMovement()->ClearPath(); - grid_service->MoveCreature(hum); - } + TraverseHumanList + ( + [this] (Human* ele_hum) -> bool + { + Human* hum = ele_hum; + if (!hum->GetBornPoint()) { + abort(); + } else { + hum->SetPos(hum->GetBornPoint()->RandPoint(this)); + } +#ifdef MYDEBUG + a8::XPrintf("set_pos side:%d %d pos:%f %f %f\n", { + hum->side, + hum->GetUniId(), + hum->GetPos().GetX(), + hum->GetPos().GetY(), + hum->GetPos().GetZ(), + }); +#endif + hum->GetMovement()->ClearPath(); + grid_service->MoveCreature(hum); + }); App::Instance()->verify_set_pos = 0; for (auto& pair : team_hash_) { pair.second->GenBattleUuid();