namreeb / namigator

An intelligent navigation API for World of Warcraft Alpha, Vanilla, TBC and WotLK
MIT License
49 stars 32 forks source link

Make C API pointers const and add line_of_sight to C API #48

Closed gtker closed 1 year ago

gtker commented 1 year ago

Hey, Got a few small changes. I'm also hoping to get working more on namigator-rs, so I'll probably be opening some issues as well.


This ensures that the underlying object can still be mutated but the pointer location can not.

This just ensures that calling functions don't have to be overly defensive about what is happening with pointers passed to the API. For example the Map pointer can't be changed to a nullptr, or to another Map object.

gtker commented 1 year ago

I accidentally left out a return statement of the pathfind_line_of_sight function, so pushed a fix for that.