Esempio n. 1
0
        bool TeleportTransport(uint newMapid, float x, float y, float z, float o)
        {
            Map oldMap = GetMap();

            if (oldMap.GetId() != newMapid)
            {
                _delayedTeleport = true;
                UnloadStaticPassengers();
                return(true);
            }
            else
            {
                UpdatePosition(x, y, z, o);

                // Teleport players, they need to know it
                foreach (var obj in _passengers)
                {
                    if (obj.IsTypeId(TypeId.Player))
                    {
                        // will be relocated in UpdatePosition of the vehicle
                        Unit veh = obj.ToUnit().GetVehicleBase();
                        if (veh)
                        {
                            if (veh.GetTransport() == this)
                            {
                                continue;
                            }
                        }

                        float destX, destY, destZ, destO;
                        obj.m_movementInfo.transport.pos.GetPosition(out destX, out destY, out destZ, out destO);
                        TransportPosHelper.CalculatePassengerPosition(ref destX, ref destY, ref destZ, ref destO, x, y, z, o);

                        obj.ToUnit().NearTeleportTo(destX, destY, destZ, destO);
                    }
                }

                return(false);
            }
        }
Esempio n. 2
0
 public void CalculatePassengerPosition(ref float x, ref float y, ref float z, ref float o)
 {
     TransportPosHelper.CalculatePassengerPosition(ref x, ref y, ref z, ref o, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
 }