diff options
author | pecksin <78765996+pecksin@users.noreply.github.com> | 2022-02-16 17:06:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-16 17:06:00 -0500 |
commit | 5d0b18a0d0bd02a9b77b8948d6887bb661a385da (patch) | |
tree | a510f83ee2e0cc78687a9009d127505a41bc2d62 /src/collision.cpp | |
parent | 258ae994915e1b9fc5b3a72627886f2ce4334902 (diff) | |
download | hax-minetest-server-5d0b18a0d0bd02a9b77b8948d6887bb661a385da.tar.gz hax-minetest-server-5d0b18a0d0bd02a9b77b8948d6887bb661a385da.zip |
Use absolute value for bouncy in collision (#11969)
* use abs(bouncy) in collision
* test case for negative bouncy
* send abs(bouncy) to old clients
Diffstat (limited to '')
-rw-r--r-- | src/collision.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/collision.cpp b/src/collision.cpp index d85a56884..ccc3a058d 100644 --- a/src/collision.cpp +++ b/src/collision.cpp @@ -303,7 +303,8 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, if (!f.walkable) continue; - int n_bouncy_value = itemgroup_get(f.groups, "bouncy"); + // Negative bouncy may have a meaning, but we need +value here. + int n_bouncy_value = abs(itemgroup_get(f.groups, "bouncy")); int neighbors = 0; if (f.drawtype == NDT_NODEBOX && |