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
1 changed files with 6 additions and 2 deletions

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;