1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-17 10:44:48 +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) {
if(c->land != laWestWall || d->land != laWestWall)
return gravityLevel(c) - gravityLevel(d);
if(c->land != laWestWall || d->land != laWestWall) {
int res = gravityLevel(c) - gravityLevel(d);
if(res > 1) return 1;
if(res < -1) return -1;
return res;
}
if(shmup::on) return 0;