Removing the constness of obstacle detection functions.

Since they can now involve calling Lua code that might do anything,
they cannot be considered const anymore.
Finish removing obstacle detection constness when entities are involved.