mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-24 05:17:17 +00:00
nilrider:: do not put the camera inside a wall
This commit is contained in:
parent
2a5e83d760
commit
0e3e3b9042
@ -152,6 +152,8 @@ void timestamp::centerview(level *lev) {
|
|||||||
hyperpoint p = inverse(View) * C0;
|
hyperpoint p = inverse(View) * C0;
|
||||||
ld room = p[2] - lev->surface(p);
|
ld room = p[2] - lev->surface(p);
|
||||||
if(room < .1 * lev->scale) return true;
|
if(room < .1 * lev->scale) return true;
|
||||||
|
for(hyperpoint h: {point3(0,0,0), point3(.001,0,0), point3(-.001,0,0), point3(0,-0.001,0), point3(0,0.001,0)})
|
||||||
|
if(lev->mapchar(p+h) == 'r') return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user