Improve AdventureBot travel recovery and destination eligibility
This commit is contained in:
1 parent
321a28640c
commit
49712aadfe
50 files changed
+984
-44
No files matched your search
@@ -166,6 +166,10 @@ Surface ClientlessFlightMgr::Sample(Player * player, Record & record, float x, f
|
||||
{
|
||||
Map * map = player->GetMap();
|
||||
uint32 terrain = PhasingHandler::GetTerrainMapId(player->GetPhaseShift(), map->GetId(), map->GetTerrain(), x, y);
|
||||
auto grid=Trinity::ComputeGridCoord(x,y);
|
||||
int32 gx=(MAX_NUMBER_OF_GRIDS-1)-grid.x_coord,gy=(MAX_NUMBER_OF_GRIDS-1)-grid.y_coord;
|
||||
if(terrain!=map->GetTerrain()->GetId() && !map->GetTerrain()->HasChildTerrainGridFile(terrain,gx,gy))
|
||||
terrain=map->GetTerrain()->GetId();
|
||||
std::string key = std::to_string(terrain) + ":" + std::to_string(int(std::floor(x / 533.33333f))) + ":" + std::to_string(int(std::floor(y / 533.33333f)));
|
||||
auto found = record.Tiles.find(key);
|
||||
if (found == record.Tiles.end()) found = record.Tiles.emplace(key, TerrainMgr::ExistMapAndVMap(terrain, x, y)).first;
|
||||
@@ -648,6 +652,9 @@ bool ClientlessFlightMgr::Command(ChatHandler * handler, char const * args)
|
||||
handler->SendSysMessage("Usage: .clientless flight status <guid> OR test_node <guid> <node>. test_node isolates flight execution; normal trips use the planner.");
|
||||
return false;
|
||||
}
|
||||
if(auto session=sWorld->FindClientlessSession(guid))if(auto player=session->GetPlayer())
|
||||
handler->PSendSysMessage("Flight capability GUID %u: enabled=%u riding=%u flightLicense=%u coldWeather=%u outdoors=%u",guid,Enabled(player)?1:0,
|
||||
player->GetSkillValue(SKILL_RIDING),player->HasSpell(90267)?1:0,player->HasSpell(54197)?1:0,(player->IsInWorld() && player->IsOutdoors())?1:0);
|
||||
if (! status) handler->SendSysMessage("No free-flight state for this character.");
|
||||
else handler->PSendSysMessage("Flight GUID %u: state=%s map=%u mountSpell=%u segments=%u avoidances=%u handoffs=%u travelled=%.1f detail='%s'", guid, StateName(status->State), status->MapId, status->MountSpell, status->Segments, status->Avoidances, status->Handoffs, status->Travelled, status->Detail.c_str());
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user