Core/Transports

* Fixed fall damage on transports while teleporting
* Fixed packets not being received by owner if sent by a controlled minion
* Fixed an issue when a teleporting transport would attempt to reload its creature passengers on old map

Closes #11140
This commit is contained in:
Shauren committed 2013-11-02 13:22:14 +01:00
1 parent 8d15c4c743
commit 39175ac680
9 files changed
+94 -113

No files matched your search

@@ -679,30 +679,6 @@ uint8 Vehicle::GetAvailableSeatCount() const
return ret;
}
void Vehicle::CalculatePassengerPosition(float& x, float& y, float& z, float* o /*= NULL*/) const
{
float inx = x, iny = y, inz = z;
if (o)
*o = Position::NormalizeOrientation(GetBase()->GetOrientation() + *o);
x = GetBase()->GetPositionX() + inx * std::cos(GetBase()->GetOrientation()) - iny * std::sin(GetBase()->GetOrientation());
y = GetBase()->GetPositionY() + iny * std::cos(GetBase()->GetOrientation()) + inx * std::sin(GetBase()->GetOrientation());
z = GetBase()->GetPositionZ() + inz;
}
void Vehicle::CalculatePassengerOffset(float& x, float& y, float& z, float* o /*= NULL*/) const
{
if (o)
*o = Position::NormalizeOrientation(*o - GetBase()->GetOrientation());
z -= GetBase()->GetPositionZ();
y -= GetBase()->GetPositionY(); // y = searchedY * std::cos(o) + searchedX * std::sin(o)
x -= GetBase()->GetPositionX(); // x = searchedX * std::cos(o) + searchedY * std::sin(o + pi)
float inx = x, iny = y;
y = (iny - inx * std::tan(GetBase()->GetOrientation())) / (std::cos(GetBase()->GetOrientation()) + std::sin(GetBase()->GetOrientation()) * std::tan(GetBase()->GetOrientation()));
x = (inx + iny * std::tan(GetBase()->GetOrientation())) / (std::cos(GetBase()->GetOrientation()) + std::sin(GetBase()->GetOrientation()) * std::tan(GetBase()->GetOrientation()));
}
/**
* @fn void Vehicle::RemovePendingEvent(VehicleJoinEvent* e)
*