tomassedovic / tcod-rs

Rust bindings for libtcod 1.6.3 (the Doryen library/roguelike toolkit)
Do What The F*ck You Want To Public License
229 stars 45 forks source link

Protect against segfault and clean up warnings #317

Closed ojhp closed 3 years ago

ojhp commented 3 years ago

Fixes #310 - Segfault appears to be in the TCOD library, it can't handle reversing an empty list in the Dijkstra example finding a path from (0, 0) to (0, 0). Added a protective check around the call the the underlying library. The A* implementation works differently enough to be unaffected from what I can see.

Fixes #297 - ... ranges replaced with ..= and unneeded brackets removed. Also updated lazy_static to latest version which resolves a deprecation warning generated from a macro in there.

I'll leave this open for a week or so before merging to give chance for comments, none of this seems urgent until the deprecations become breaking.

tomassedovic commented 3 years ago

Great stuff, thank you!