diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Player.cpp | 34 |
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) { |