Fixed Pathfinder not registering spikes & other grid entities

This commit is contained in:
Wofsauge committed 2025-03-09 18:30:26 +01:00
1 parent 89f4dacf74
commit 74d46e9704
1 file changed
+5 -2
+5 -2
View File
@@ -3161,8 +3161,11 @@ function EID:EvaluateLocation(gridPosition)
return false
end
local gridIndex = gridPosition.x * room:GetGridWidth() + gridPosition.y
local collision = room:GetGridCollision(gridIndex)
return collision == GridCollisionClass.COLLISION_NONE or collision == GridCollisionClass.COLLISION_WALL_EXCEPT_PLAYER
-- GridPath contains a value that defines if a poisiton is walkable by the ingame pathfinder
-- numbers bigger 900 are considered not walkable (spikes, rocks, pits, grimaces, etc.)
-- numbers smaller 900 are walkable but less preferable. 0 is most preferable
local collision = room:GetGridPath(gridIndex)
return collision <= 900
end
---Returns true if an unobstructed path between the start and end position exists.