瀏覽代碼

Fix distance checking for "/phb next"

I hate dealing with position and coordinates, but it should be fixed now
Lilith Song 3 年之前
父節點
當前提交
b8ced43c23
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      HuntBuddy/Plugin.cs

+ 2 - 1
HuntBuddy/Plugin.cs

@@ -165,7 +165,8 @@ namespace HuntBuddy
 					{
 						var openType = Location.OpenType.None;
 						var playerLocation = Plugin.ClientState.LocalPlayer!.Position;
-						var playerVec2 = new Vector2(playerLocation.X, playerLocation.Z);
+						var map = Plugin.DataManager.GetExcelSheet<TerritoryType>()!.GetRow(Plugin.ClientState.TerritoryType)!.Map!.Value!;
+						var playerVec2 = MapUtil.WorldToMap(new Vector2(playerLocation.X, playerLocation.Z), map);
 						var chosen = this.CurrentAreaMobHuntEntries
 							.Where(entry => this.MobHuntStruct->CurrentKills[entry.CurrentKillsOffset] < entry.NeededKills)
 							.OrderBy(entry => Vector2.Distance(Location.Database[entry.MobHuntId].Coordinate, playerVec2))