aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/MiscHandler.cpp
diff options
context:
space:
mode:
authorIntel <chemicstry@gmail.com>2014-11-06 01:13:06 +0200
committerIntel <chemicstry@gmail.com>2014-11-06 01:13:06 +0200
commit5f2b5a325b90d66915f0f8f18b9d29f22dfaf754 (patch)
tree9d4322e53e87b565efd28069d5a5554860fcb2ae /src/server/game/Handlers/MiscHandler.cpp
parent3fe1ad51baa8c4bdf1506b7d176ffa3f11b68abc (diff)
Core/DataStores: Updated AreaTrigger.dbc struct
Diffstat (limited to 'src/server/game/Handlers/MiscHandler.cpp')
-rw-r--r--src/server/game/Handlers/MiscHandler.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp
index 788ebd693dd..7e7b5aa1ab5 100644
--- a/src/server/game/Handlers/MiscHandler.cpp
+++ b/src/server/game/Handlers/MiscHandler.cpp
@@ -867,24 +867,24 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData)
return;
}
- if (player->GetMapId() != atEntry->mapid)
+ if (player->GetMapId() != atEntry->ContinentID)
{
TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u",
- player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->mapid, player->GetMapId(), triggerId);
+ player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->ContinentID, player->GetMapId(), triggerId);
return;
}
// delta is safe radius
const float delta = 5.0f;
- if (atEntry->radius > 0)
+ if (atEntry->Radius > 0)
{
// if we have radius check it
- float dist = player->GetDistance(atEntry->x, atEntry->y, atEntry->z);
- if (dist > atEntry->radius + delta)
+ float dist = player->GetDistance(atEntry->Pos[0], atEntry->Pos[1], atEntry->Pos[2]);
+ if (dist > atEntry->Radius + delta)
{
TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (radius: %f distance: %f), ignore Area Trigger ID: %u",
- player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->radius, dist, triggerId);
+ player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->Radius, dist, triggerId);
return;
}
}
@@ -896,26 +896,26 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData)
// is-in-cube check and we have to calculate only one point instead of 4
// 2PI = 360°, keep in mind that ingame orientation is counter-clockwise
- double rotation = 2 * M_PI - atEntry->box_orientation;
+ double rotation = 2 * M_PI - atEntry->BoxYaw;
double sinVal = std::sin(rotation);
double cosVal = std::cos(rotation);
- float playerBoxDistX = player->GetPositionX() - atEntry->x;
- float playerBoxDistY = player->GetPositionY() - atEntry->y;
+ float playerBoxDistX = player->GetPositionX() - atEntry->Pos[0];
+ float playerBoxDistY = player->GetPositionY() - atEntry->Pos[1];
- float rotPlayerX = float(atEntry->x + playerBoxDistX * cosVal - playerBoxDistY*sinVal);
- float rotPlayerY = float(atEntry->y + playerBoxDistY * cosVal + playerBoxDistX*sinVal);
+ float rotPlayerX = float(atEntry->Pos[0] + playerBoxDistX * cosVal - playerBoxDistY*sinVal);
+ float rotPlayerY = float(atEntry->Pos[1] + playerBoxDistY * cosVal + playerBoxDistX*sinVal);
// box edges are parallel to coordiante axis, so we can treat every dimension independently :D
- float dz = player->GetPositionZ() - atEntry->z;
- float dx = rotPlayerX - atEntry->x;
- float dy = rotPlayerY - atEntry->y;
- if ((std::fabs(dx) > atEntry->box_x / 2 + delta) ||
- (std::fabs(dy) > atEntry->box_y / 2 + delta) ||
- (std::fabs(dz) > atEntry->box_z / 2 + delta))
+ float dz = player->GetPositionZ() - atEntry->Pos[2];
+ float dx = rotPlayerX - atEntry->Pos[0];
+ float dy = rotPlayerY - atEntry->Pos[1];
+ if ((std::fabs(dx) > atEntry->BoxLength / 2 + delta) ||
+ (std::fabs(dy) > atEntry->BoxWidth / 2 + delta) ||
+ (std::fabs(dz) > atEntry->BoxHeight / 2 + delta))
{
TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far (1/2 box X: %f 1/2 box Y: %f 1/2 box Z: %f rotatedPlayerX: %f rotatedPlayerY: %f dZ:%f), ignore Area Trigger ID: %u",
- player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->box_x / 2, atEntry->box_y / 2, atEntry->box_z / 2, rotPlayerX, rotPlayerY, dz, triggerId);
+ player->GetName().c_str(), player->GetGUID().ToString().c_str(), atEntry->BoxLength / 2, atEntry->BoxWidth / 2, atEntry->BoxHeight / 2, rotPlayerX, rotPlayerY, dz, triggerId);
return;
}
}
@@ -935,7 +935,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recvData)
{
// set resting flag we are in the inn
player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING);
- player->InnEnter(time(NULL), atEntry->mapid, atEntry->x, atEntry->y, atEntry->z);
+ player->InnEnter(time(NULL), atEntry->ContinentID, atEntry->Pos[0], atEntry->Pos[1], atEntry->Pos[2]);
player->SetRestType(REST_TYPE_IN_TAVERN);
if (sWorld->IsFFAPvPRealm())