Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: infinite loop in Zone:randomPosition when no valid tile exist (#…
…3178) This commit fixes an infinite loop issue in the `Zone:randomPosition` function. When no valid positions (walkable tiles) exist in the zone, the function would previously enter an infinite loop. The updated logic now filters all positions upfront to identify walkable tiles, and if none are found, the function returns `nil` with appropriate logging. This change ensures better error handling and prevents server freezes due to infinite loops.
- Loading branch information