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

This commit is contained in:
VladimirMangos 2009-05-06 06:35:21 +04:00
parent b7417440df
commit 75dda239d7
2 changed files with 27 additions and 9 deletions

View file

@ -16736,11 +16736,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() ||
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);
@ -16807,9 +16827,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, uint32 mount_i
uint32 money = GetMoney();
if (npc)
{
totalcost = (uint32)ceil(totalcost*GetReputationPriceDiscount(npc));
}
if(money < totalcost)
{

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "7783"
#define REVISION_NR "7784"
#endif // __REVISION_NR_H__