1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-09 01:10:43 +00:00

Fixed pathfinding crash (#301)

This commit is contained in:
Tim Sarbin 2020-02-08 21:33:14 -05:00 committed by GitHub
parent 5e958b9174
commit 9478e2c2be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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