mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
ray:: reset raycaster on geometry change
This commit is contained in:
parent
d24971fef0
commit
4df677f22f
@ -47,6 +47,8 @@ ld& maxstep_current() {
|
|||||||
|
|
||||||
#define IN_ODS 0
|
#define IN_ODS 0
|
||||||
|
|
||||||
|
eGeometry last_geometry;
|
||||||
|
|
||||||
/** is the raycaster available? */
|
/** is the raycaster available? */
|
||||||
EX bool available() {
|
EX bool available() {
|
||||||
if(WDIM == 2) return false;
|
if(WDIM == 2) return false;
|
||||||
@ -105,6 +107,8 @@ shared_ptr<raycaster> our_raycaster;
|
|||||||
EX void reset_raycaster() { our_raycaster = nullptr; };
|
EX void reset_raycaster() { our_raycaster = nullptr; };
|
||||||
|
|
||||||
void enable_raycaster() {
|
void enable_raycaster() {
|
||||||
|
if(geometry != last_geometry) reset_raycaster();
|
||||||
|
last_geometry = geometry;
|
||||||
if(!our_raycaster) {
|
if(!our_raycaster) {
|
||||||
bool use_reflect = false;
|
bool use_reflect = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user