Merge branch 'master' of https://github.com/azerothcore/azerothcore-wotlk into dir-restructure

This commit is contained in:
Yehonal
2017-12-21 11:26:43 +01:00
445 changed files with 49192 additions and 15431 deletions

View File

@@ -400,8 +400,8 @@ public:
object->GetZoneAndAreaId(zoneId, areaId);
MapEntry const* mapEntry = sMapStore.LookupEntry(object->GetMapId());
AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zoneId);
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(areaId);
AreaTableEntry const* zoneEntry = sAreaTableStore.LookupEntry(zoneId);
AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(areaId);
float zoneX = object->GetPositionX();
float zoneY = object->GetPositionY();
@@ -612,8 +612,8 @@ public:
else
_player->SaveRecallPosition();
_player->TeleportTo(target->GetMapId(), target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()+0.25f, _player->GetOrientation(), TELE_TO_GM_MODE);
_player->SetPhaseMask(target->GetPhaseMask() | 1, false);
if (_player->TeleportTo(target->GetMapId(), target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()+0.25f, _player->GetOrientation(), TELE_TO_GM_MODE, target))
_player->SetPhaseMask(target->GetPhaseMask() | 1, false);
}
else
{
@@ -734,8 +734,8 @@ public:
// before GM
float x, y, z;
handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, target->GetObjectSize());
target->TeleportTo(handler->GetSession()->GetPlayer()->GetMapId(), x, y, z, target->GetOrientation());
target->SetPhaseMask(handler->GetSession()->GetPlayer()->GetPhaseMask(), false);
if (target->TeleportTo(handler->GetSession()->GetPlayer()->GetMapId(), x, y, z, target->GetOrientation(), 0, handler->GetSession()->GetPlayer()))
target->SetPhaseMask(handler->GetSession()->GetPlayer()->GetPhaseMask(), false);
}
else
{
@@ -845,7 +845,7 @@ public:
// before GM
float x, y, z;
handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, player->GetObjectSize());
player->TeleportTo(handler->GetSession()->GetPlayer()->GetMapId(), x, y, z, player->GetOrientation());
player->TeleportTo(handler->GetSession()->GetPlayer()->GetMapId(), x, y, z, player->GetOrientation(), 0, handler->GetSession()->GetPlayer());
}
return true;
@@ -1280,7 +1280,7 @@ public:
uint32 zoneId = player->GetZoneId();
AreaTableEntry const* areaEntry = GetAreaEntryByAreaID(zoneId);
AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(zoneId);
if (!areaEntry || areaEntry->zone !=0)
{
handler->PSendSysMessage(LANG_COMMAND_GRAVEYARDWRONGZONE, graveyardId, zoneId);
@@ -1411,17 +1411,23 @@ public:
return false;
}
int32 area = GetAreaFlagByAreaID(atoi((char*)args));
int32 offset = area / 32;
uint32 val = uint32((1 << (area % 32)));
if (area<0 || offset >= PLAYER_EXPLORED_ZONES_SIZE)
AreaTableEntry const* area = sAreaTableStore.LookupEntry(atoi(args));
if (!area)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
int32 offset = area->exploreFlag / 32;
if (offset >= PLAYER_EXPLORED_ZONES_SIZE)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
uint32 val = uint32((1 << (area->exploreFlag % 32)));
uint32 currFields = playerTarget->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset);
playerTarget->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, uint32((currFields | val)));
@@ -1442,17 +1448,23 @@ public:
return false;
}
int32 area = GetAreaFlagByAreaID(atoi((char*)args));
int32 offset = area / 32;
uint32 val = uint32((1 << (area % 32)));
if (area < 0 || offset >= PLAYER_EXPLORED_ZONES_SIZE)
AreaTableEntry const* area = sAreaTableStore.LookupEntry(atoi(args));
if (!area)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
int32 offset = area->exploreFlag / 32;
if (offset >= PLAYER_EXPLORED_ZONES_SIZE)
{
handler->SendSysMessage(LANG_BAD_VALUE);
handler->SetSentErrorMessage(true);
return false;
}
uint32 val = uint32((1 << (area->exploreFlag % 32)));
uint32 currFields = playerTarget->GetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset);
playerTarget->SetUInt32Value(PLAYER_EXPLORED_ZONES_1 + offset, uint32((currFields ^ val)));
@@ -2025,12 +2037,12 @@ public:
MapEntry const* map = sMapStore.LookupEntry(mapId);
AreaTableEntry const* area = GetAreaEntryByAreaID(areaId);
AreaTableEntry const* area = sAreaTableStore.LookupEntry(areaId);
if (area)
{
areaName = area->area_name[locale];
AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone);
AreaTableEntry const* zone = sAreaTableStore.LookupEntry(area->zone);
if (zone)
zoneName = zone->area_name[locale];
}