public void SetOffset(UInt16 OffX, UInt16 OffY) { if (OffX <= 0 || OffY <= 0) { return; } XOffset = OffX; YOffset = OffY; XZone = (uint)(OffX << 12); YZone = (uint)(OffY << 12); if (IsInWorld()) { Region.CheckZone(this); } }
/// <summary> /// Sets the object's X and Y offsets for coordinate calculations. /// Return whether or not the player's zone changed as a result of this. /// </summary> /// <param name="offX"></param> /// <param name="offY"></param> /// <returns></returns> public ushort SetOffset(ushort offX, ushort offY, bool checkZone = true) { Player player = this as Player; if (player != null && player.MoveBlock) { return(0); } if (offX == 0 || offY == 0) { return(0); } XOffset = offX; YOffset = offY; if (checkZone && IsInWorld()) { return(Region.CheckZone(this)); } return(0); }