aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-06 16:42:17 -0500
committermegamage <none@none>2009-05-06 16:42:17 -0500
commit8c4a1110506de017f6257184a5558eca0378e7e4 (patch)
tree312781c7723db294e10881f21a7b6e0e5f019650 /src
parentfce448a52175fc3ce03bd168e5edaf152d06b473 (diff)
[7784] Skip distance to start taxi node in case node without coordinates and taxi flight started by spell. Author: VladimirMangos
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Player.cpp34
1 files changed, 26 insertions, 8 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index ae13c8136f0..cb2e908c069 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -17143,11 +17143,31 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, uint32 mount_i
// starting node too far away (cheat?)
TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(sourcenode);
- if( !node || node->map_id != GetMapId() ||
- (node->x - GetPositionX())*(node->x - GetPositionX())+
- (node->y - GetPositionY())*(node->y - GetPositionY())+
- (node->z - GetPositionZ())*(node->z - GetPositionZ()) >
- (2*INTERACTION_DISTANCE)*(2*INTERACTION_DISTANCE)*(2*INTERACTION_DISTANCE) )
+ if (!node)
+ {
+ WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4);
+ data << uint32(ERR_TAXINOSUCHPATH);
+ GetSession()->SendPacket(&data);
+ return false;
+ }
+
+ // check node starting pos data set case if provided
+ if (node->x != 0.0f || node->y != 0.0f || node->z != 0.0f)
+ {
+ if (node->map_id != GetMapId() ||
+ (node->x - GetPositionX())*(node->x - GetPositionX())+
+ (node->y - GetPositionY())*(node->y - GetPositionY())+
+ (node->z - GetPositionZ())*(node->z - GetPositionZ()) >
+ (2*INTERACTION_DISTANCE)*(2*INTERACTION_DISTANCE)*(2*INTERACTION_DISTANCE))
+ {
+ WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4);
+ data << uint32(ERR_TAXITOOFARAWAY);
+ GetSession()->SendPacket(&data);
+ return false;
+ }
+ }
+ // node must have pos if not spell case (npc!=0)
+ else if(npc)
{
WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4);
data << uint32(ERR_TAXIUNSPECIFIEDSERVERERROR);
@@ -17213,10 +17233,8 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, uint32 mount_i
uint32 money = GetMoney();
- if(npc)
- {
+ if (npc)
totalcost = (uint32)ceil(totalcost*GetReputationPriceDiscount(npc));
- }
if(money < totalcost)
{