So, I came in trying to fix gameobject LoS. So I restructured some stuff.

Port From (https://github.com/TrinityCore/TrinityCore/commit/5392212799b669d91c80cf0e9539a3aaa2abbe79)
This commit is contained in:
hondacrx
2020-07-23 19:01:15 -04:00
parent 58e630448d
commit ddaaae896e
9 changed files with 64 additions and 30 deletions
+9 -2
View File
@@ -494,8 +494,15 @@ namespace Game.Chat
{
Unit unit = handler.GetSelectedUnit();
if (unit)
handler.SendSysMessage("Unit {0} (GuidLow: {1}) is {2}in LoS", unit.GetName(), unit.GetGUID().ToString(), handler.GetSession().GetPlayer().IsWithinLOSInMap(unit) ? "" : "not ");
return true;
{
Player player = handler.GetSession().GetPlayer();
handler.SendSysMessage($"Checking LoS {player.GetName()} -> {unit.GetName()}:");
handler.SendSysMessage($" VMAP LoS: {(player.IsWithinLOSInMap(unit, LineOfSightChecks.Vmap) ? "clear" : "obstructed")}");
handler.SendSysMessage($" GObj LoS: {(player.IsWithinLOSInMap(unit, LineOfSightChecks.Gobject) ? "clear" : "obstructed")}");
handler.SendSysMessage($"{unit.GetName()} is {(player.IsWithinLOSInMap(unit) ? "" : "not ")}in line of sight of {player.GetName()}.");
return true;
}
return false;
}
[Command("moveflags", RBACPermissions.CommandDebugMoveflags)]