Changeset 4590 for 2013/30/DenisZ/CastleMaster/CastleMaster/CastleMaster/Ai
- Timestamp:
- 2013-07-23 19:11:27 (8 years ago)
- 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 55 55 } 56 56 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); 60 60 nodeMap = new Node[level.Width * level.Height]; 61 61 open.Clear(); -
2013/30/DenisZ/CastleMaster/CastleMaster/CastleMaster/Ai/Orders/OrderMove.cs
r4581 r4590 13 13 private float x, z; 14 14 private int ppi = 0; 15 private bool excludeEndSolidness; 16 private float stopDistance; 15 17 16 public OrderMove(float x, float z )18 public OrderMove(float x, float z, float stopDistance = 2.0F, bool excludeEndSolidness = false) 17 19 { 20 this.stopDistance = stopDistance; 21 this.excludeEndSolidness = excludeEndSolidness; 18 22 this.x = x; 19 23 this.z = z; … … 23 27 { 24 28 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); 26 30 return this; 27 31 } … … 62 66 get 63 67 { 64 return (mob.DistanceTo(x, z) < 2.0F) || !mob.PathFinder.CanFindPath;68 return (mob.DistanceTo(x, z) < stopDistance) || !mob.PathFinder.CanFindPath; 65 69 } 66 70 }
Note: See TracChangeset
for help on using the changeset viewer.