From 93d199f04382fe3c7f6f08f59fd2ad058568679a Mon Sep 17 00:00:00 2001 From: Subv2112 Date: Fri, 3 Feb 2012 16:03:52 -0500 Subject: Core/Collision: Ported dynamic line of sight patch by Silverice from MaNGOS and added lots of improvements Please re-extract vmaps --- src/server/scripts/Commands/cs_debug.cpp | 8 ++++++++ src/server/scripts/Commands/cs_gps.cpp | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 311c6586a0f..73e6b0ac8a5 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -88,6 +88,7 @@ public: { "update", SEC_ADMINISTRATOR, false, &HandleDebugUpdateCommand, "", NULL }, { "itemexpire", SEC_ADMINISTRATOR, false, &HandleDebugItemExpireCommand, "", NULL }, { "areatriggers", SEC_ADMINISTRATOR, false, &HandleDebugAreaTriggersCommand, "", NULL }, + { "los", SEC_MODERATOR, false, &HandleDebugLoSCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = @@ -1040,6 +1041,13 @@ public: handler->GetSession()->GetPlayer()->HandleEmoteCommand(animId); return true; } + + static bool HandleDebugLoSCommand(ChatHandler* handler, char const* args) + { + if (Unit* unit = handler->getSelectedUnit()) + handler->PSendSysMessage("Unit %s (GuidLow: %u) is %sin LoS", unit->GetName(), unit->GetGUIDLow(), handler->GetSession()->GetPlayer()->IsWithinLOSInMap(unit) ? "" : "not "); + return true; + } static bool HandleDebugSetAuraStateCommand(ChatHandler* handler, char const* args) { diff --git a/src/server/scripts/Commands/cs_gps.cpp b/src/server/scripts/Commands/cs_gps.cpp index 8f15f8c9ce3..589ed4af3b8 100644 --- a/src/server/scripts/Commands/cs_gps.cpp +++ b/src/server/scripts/Commands/cs_gps.cpp @@ -87,8 +87,8 @@ public: Map2ZoneCoordinates(zoneX, zoneY, zoneId); Map const* map = object->GetMap(); - float groundZ = map->GetHeight(object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT); - float floorZ = map->GetHeight(object->GetPositionX(), object->GetPositionY(), object->GetPositionZ()); + float groundZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT); + float floorZ = map->GetHeight(object->GetPhaseMask(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ()); GridCoord gridCoord = Trinity::ComputeGridCoord(object->GetPositionX(), object->GetPositionY()); -- cgit v1.2.3