From 8fd7a540e3c61e275610d2fa77d815139fa47308 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Fri, 20 May 2022 10:39:55 +0300 Subject: [PATCH] Limit knockdown distance --- src/actions.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/actions.c b/src/actions.c index c07995d..73c2e16 100644 --- a/src/actions.c +++ b/src/actions.c @@ -31,6 +31,8 @@ #include #include +#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++) {