Created
          November 13, 2017 01:01 
        
      - 
      
- 
        Save Jadd/41b4bc2ace3d8b97fc7deaa126bf3a26 to your computer and use it in GitHub Desktop. 
Revisions
- 
        Jadd created this gist Nov 13, 2017 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ using Afterglow.Internal.Client.Objects; using Albion.Common.Photon; using UnityEngine; namespace Afterglow.Internal.Client.Detection { public class MaxViewDetection : PacketHandler { protected override void OnPacketEvent(PacketInfo packet) { if (packet.Type != PacketType.OperationRequest) return; if (packet.Opcode != OperationCodes.Move) return; var movement = (acc) packet.Data; var movementPosition = new Vector2(movement.ayo[0], movement.ayo[1]); var movementClick = new Vector2(movement.ayq[0], movement.ayq[1]); // The distance does not indicate that we can see further than 10 units, so we're safe! if (Vector2.Distance(movementPosition, movementClick) <= 10f) return; // Limit the destination to 9-10 units; remove the interaction target. movementClick = Vector2.MoveTowards(movementPosition, movementClick, Random.Range(9f, 10f)); movement.ayq[0] = movementClick.x; movement.ayq[1] = movementClick.y; movement.ays = 0; } } }