Limit knockdown distance

This commit is contained in:
Alexander Batalov 2022-05-20 10:39:55 +03:00
parent 6e4f7e6c8c
commit 8fd7a540e3
1 changed files with 7 additions and 0 deletions

View File

@ -31,6 +31,8 @@
#include <limits.h>
#include <string.h>
#define MAX_KNOCKDOWN_DISTANCE 20
// 0x5106D0
int _action_in_explode = 0;
@ -70,6 +72,11 @@ int actionKnockdown(Object* obj, int* anim, int maxDistance, int rotation, int d
}
}
// SFALL: Fix to limit the maximum distance for the knockback animation.
if (maxDistance > MAX_KNOCKDOWN_DISTANCE) {
maxDistance = MAX_KNOCKDOWN_DISTANCE;
}
int distance;
int tile;
for (distance = 1; distance <= maxDistance; distance++) {