mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-09-27 21:56:19 -04:00
Fixed pathfinding crash (#301)
This commit is contained in:
parent
5e958b9174
commit
9478e2c2be
@ -154,10 +154,10 @@ func loadRegion(seed int64, tileOffsetX, tileOffsetY int, levelType d2enum.Regio
|
|||||||
|
|
||||||
func (mr *MapRegion) generateWalkableMatrix() {
|
func (mr *MapRegion) generateWalkableMatrix() {
|
||||||
mr.walkableArea = make([][]PathTile, mr.tileRect.Height*5)
|
mr.walkableArea = make([][]PathTile, mr.tileRect.Height*5)
|
||||||
for y := 0; y < mr.tileRect.Height*5; y++ {
|
for y := 0; y < (mr.tileRect.Height - 1)*5; y++ {
|
||||||
mr.walkableArea[y] = make([]PathTile, mr.tileRect.Width*5)
|
mr.walkableArea[y] = make([]PathTile, mr.tileRect.Width*5)
|
||||||
ty := int(float64(y) / 5.0)
|
ty := int(float64(y) / 5.0)
|
||||||
for x := 0; x < mr.tileRect.Width*5; x++ {
|
for x := 0; x < (mr.tileRect.Width-1)*5; x++ {
|
||||||
tx := int(float64(x) / 5.0)
|
tx := int(float64(x) / 5.0)
|
||||||
tile := mr.GetTile(tx, ty)
|
tile := mr.GetTile(tx, ty)
|
||||||
isBlocked := false
|
isBlocked := false
|
||||||
|
Loading…
Reference in New Issue
Block a user