fix: teleport to Limsa for world transfer if necessary

This commit is contained in:
Anna 2021-06-20 05:33:29 -04:00
parent 35f17a694c
commit 05b751ed91
2 changed files with 16 additions and 2 deletions

View File

@ -30,5 +30,14 @@ namespace RoleplayersToolbox.Tools.Housing {
public static TerritoryType CityState(this HousingArea area, DataManager data) {
return data.GetExcelSheet<TerritoryType>().GetRow(area.CityStateTerritoryType());
}
public static bool CanWorldTravel(this HousingArea area) {
return area switch {
HousingArea.Mist => true,
HousingArea.LavenderBeds => true,
HousingArea.Goblet => true,
_ => false,
};
}
}
}

View File

@ -172,9 +172,14 @@ namespace RoleplayersToolbox.Tools.Housing {
if (this.Destination?.Area != null) {
ImGui.SameLine();
var name = this.Destination.Area.Value.CityState(this.Plugin.Interface.Data).PlaceName.Value.Name;
var destArea = this.Destination.Area.Value;
if (!destArea.CanWorldTravel() && this.Destination?.World != null && this.Destination?.World != this.Plugin.Interface.ClientState.LocalPlayer?.CurrentWorld?.GameData) {
destArea = HousingArea.Mist;
}
var name = destArea.CityState(this.Plugin.Interface.Data).PlaceName.Value.Name;
if (ImGui.Button($"Teleport to {name}")) {
this.Teleport.TeleportToHousingArea(this.Destination.Area.Value);
this.Teleport.TeleportToHousingArea(destArea);
}
}