1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-18 14:45:12 +00:00

improved the automatic rotation

This commit is contained in:
Zeno Rogue
2018-03-25 15:07:11 +02:00
parent 4d2fc2ba76
commit a10491f3d6
8 changed files with 58 additions and 14 deletions

View File

@@ -549,11 +549,9 @@ void centerpc(ld aspd) {
if(vid.sspeed >= 4.99) aspd = 1000;
DEBB(DF_GRAPH, (debugfile,"center pc\n"));
hyperpoint H = ypush(-vid.yshift) * sphereflip * tC0(cwtV);
if(H[0] == 0 && H[1] == 0) {
return; // either already centered or direction unknown
}
ld R = hdist0(H); // = sqrt(H[0] * H[0] + H[1] * H[1]);
ld R = H[0] == 0 && H[1] == 0 ? 0 : hdist0(H); // = sqrt(H[0] * H[0] + H[1] * H[1]);
if(R < 1e-9) {
// either already centered or direction unknown
/* if(playerfoundL && playerfoundR) {
} */