1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-18 23:10:26 +00:00

gravityLevelDiff is now clamped to [-1,1]

This commit is contained in:
Zeno Rogue 2021-08-08 17:23:17 +02:00
parent 6a3e12836f
commit e55fe37803

View File

@ -587,8 +587,12 @@ EX int gravityLevel(cell *c) {
} }
EX int gravityLevelDiff(cell *c, cell *d) { EX int gravityLevelDiff(cell *c, cell *d) {
if(c->land != laWestWall || d->land != laWestWall) if(c->land != laWestWall || d->land != laWestWall) {
return gravityLevel(c) - gravityLevel(d); int res = gravityLevel(c) - gravityLevel(d);
if(res > 1) return 1;
if(res < -1) return -1;
return res;
}
if(shmup::on) return 0; if(shmup::on) return 0;