Ignore:
Timestamp:
2013-07-23 19:11:27 (8 years ago)
Author:
dezhidki
Message:

Puut lisätty, woodcutter toimii.

Location:
2013/30/DenisZ/CastleMaster/CastleMaster/CastleMaster/Ai
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 2013/30/DenisZ/CastleMaster/CastleMaster/CastleMaster/Ai/AStar.cs

    r4581 r4590  
    5555        } 
    5656 
    57         public void InitializePathFinder(int xStart, int zStart, int xEnd, int zEnd) 
    58         { 
    59             tiles = level.BuildSolidnessTable(mob); 
     57        public void InitializePathFinder(int xStart, int zStart, int xEnd, int zEnd, bool ignoreSolidnessForEnd) 
     58        { 
     59            tiles = level.BuildSolidnessTable(mob, ignoreSolidnessForEnd, xEnd, zEnd); 
    6060            nodeMap = new Node[level.Width * level.Height]; 
    6161            open.Clear(); 
  • 2013/30/DenisZ/CastleMaster/CastleMaster/CastleMaster/Ai/Orders/OrderMove.cs

    r4581 r4590  
    1313        private float x, z; 
    1414        private int ppi = 0; 
     15        private bool excludeEndSolidness; 
     16        private float stopDistance; 
    1517 
    16         public OrderMove(float x, float z) 
     18        public OrderMove(float x, float z, float stopDistance = 2.0F, bool excludeEndSolidness = false) 
    1719        { 
     20            this.stopDistance = stopDistance; 
     21            this.excludeEndSolidness = excludeEndSolidness; 
    1822            this.x = x; 
    1923            this.z = z; 
     
    2327        { 
    2428            base.Initialize(mob); 
    25             mob.PathFinder.InitializePathFinder((int)(mob.X / Viewport.TILESIZE), (int)(mob.Z / Viewport.TILESIZE), (int)(x / Viewport.TILESIZE), (int)(z / Viewport.TILESIZE)); 
     29            mob.PathFinder.InitializePathFinder((int)(mob.X / Viewport.TILESIZE), (int)(mob.Z / Viewport.TILESIZE), (int)(x / Viewport.TILESIZE), (int)(z / Viewport.TILESIZE), excludeEndSolidness); 
    2630            return this; 
    2731        } 
     
    6266            get 
    6367            { 
    64                 return (mob.DistanceTo(x, z) < 2.0F) || !mob.PathFinder.CanFindPath; 
     68                return (mob.DistanceTo(x, z) < stopDistance) || !mob.PathFinder.CanFindPath; 
    6569            } 
    6670        } 
Note: See TracChangeset for help on using the changeset viewer.