mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-02-20 07:27:19 -05: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() {
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user