1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Use absolute value for bouncy in collision (#11969)

* use abs(bouncy) in collision
* test case for negative bouncy
* send abs(bouncy) to old clients
This commit is contained in:
pecksin 2022-02-16 17:06:00 -05:00 committed by GitHub
parent 258ae99491
commit 5d0b18a0d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View file

@ -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 &&