1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 01:00:25 +00:00

ray:: reset raycaster on geometry change

This commit is contained in:
Zeno Rogue 2019-10-26 17:03:10 +02:00
parent d24971fef0
commit 4df677f22f

View File

@ -47,6 +47,8 @@ ld& maxstep_current() {
#define IN_ODS 0
eGeometry last_geometry;
/** is the raycaster available? */
EX bool available() {
if(WDIM == 2) return false;
@ -105,6 +107,8 @@ shared_ptr<raycaster> our_raycaster;
EX void reset_raycaster() { our_raycaster = nullptr; };
void enable_raycaster() {
if(geometry != last_geometry) reset_raycaster();
last_geometry = geometry;
if(!our_raycaster) {
bool use_reflect = false;