mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[7784] Skip distance to start taxi node in case node without coordinates and taxi flight started by spell.
This commit is contained in:
parent
b7417440df
commit
75dda239d7
2 changed files with 27 additions and 9 deletions
|
|
@ -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() ||
|
||||
(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);
|
||||
|
|
@ -16806,10 +16826,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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue