Scripts: replaced various Location struct defines with proper Position or G3D::Vector3

This commit is contained in:
joschiwald
2014-10-26 01:46:28 +02:00
parent 10fb948c40
commit 747350a0bc
13 changed files with 118 additions and 160 deletions

View File

@@ -1632,6 +1632,13 @@ void Position::GetPositionOffsetTo(const Position & endPos, Position & retOffset
retOffset.SetOrientation(endPos.GetOrientation() - GetOrientation());
}
Position Position::GetPositionWithOffset(Position const& offset) const
{
Position ret(*this);
ret.RelocateOffset(offset);
return ret;
}
float Position::GetAngle(const Position* obj) const
{
if (!obj)
@@ -2797,7 +2804,7 @@ void WorldObject::DestroyForNearbyPlayers()
if (!player->HaveAtClient(this))
continue;
if (isType(TYPEMASK_UNIT) && ((Unit*)this)->GetCharmerGUID() == player->GetGUID()) /// @todo this is for puppet
if (isType(TYPEMASK_UNIT) && ToUnit()->GetCharmerGUID() == player->GetGUID()) /// @todo this is for puppet
continue;
DestroyForPlayer(player);