[7784] Skip distance to start taxi node in case node without coordinates and taxi flight started by spell. Author: VladimirMangos

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-06 16:42:17 -05:00
parent fce448a521
commit 8c4a111050
+26 -8
View File
@@ -17143,11 +17143,31 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, uint32 mount_i
// starting node too far away (cheat?) // starting node too far away (cheat?)
TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(sourcenode); TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(sourcenode);
if( !node || node->map_id != GetMapId() || if (!node)
(node->x - GetPositionX())*(node->x - GetPositionX())+ {
(node->y - GetPositionY())*(node->y - GetPositionY())+ WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4);
(node->z - GetPositionZ())*(node->z - GetPositionZ()) > data << uint32(ERR_TAXINOSUCHPATH);
(2*INTERACTION_DISTANCE)*(2*INTERACTION_DISTANCE)*(2*INTERACTION_DISTANCE) ) 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); WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4);
data << uint32(ERR_TAXIUNSPECIFIEDSERVERERROR); data << uint32(ERR_TAXIUNSPECIFIEDSERVERERROR);
@@ -17213,10 +17233,8 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, uint32 mount_i
uint32 money = GetMoney(); uint32 money = GetMoney();
if(npc) if (npc)
{
totalcost = (uint32)ceil(totalcost*GetReputationPriceDiscount(npc)); totalcost = (uint32)ceil(totalcost*GetReputationPriceDiscount(npc));
}
if(money < totalcost) if(money < totalcost)
{ {