Skip to content

Commit

Permalink
Fixed pathfinding crash (OpenDiablo2#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
essial authored Feb 9, 2020
1 parent 5e958b9 commit 9478e2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions d2core/d2map/region.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ func loadRegion(seed int64, tileOffsetX, tileOffsetY int, levelType d2enum.Regio

func (mr *MapRegion) generateWalkableMatrix() {
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)
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)
tile := mr.GetTile(tx, ty)
isBlocked := false
Expand Down

0 comments on commit 9478e2c

Please sign in to comment.