aboutsummaryrefslogtreecommitdiff
path: root/src/nodedef.cpp
diff options
context:
space:
mode:
authorpecksin <78765996+pecksin@users.noreply.github.com>2022-02-16 17:06:00 -0500
committersfan5 <sfan5@live.de>2022-05-14 18:33:42 +0200
commit62ad2c3bc1dd3a1a70d9eefbe2fac8fcbe426a1b (patch)
tree5bd5af4f3d02611f541080aa6b851f0bdacba65e /src/nodedef.cpp
parent25373ad294398b752ad0ef4a52a5585a0b957f0b (diff)
downloadminetest-62ad2c3bc1dd3a1a70d9eefbe2fac8fcbe426a1b.tar.gz
minetest-62ad2c3bc1dd3a1a70d9eefbe2fac8fcbe426a1b.tar.bz2
minetest-62ad2c3bc1dd3a1a70d9eefbe2fac8fcbe426a1b.zip
Use absolute value for bouncy in collision (#11969)
[backport: removed devtest change and protocol_version comparison]
Diffstat (limited to 'src/nodedef.cpp')
-rw-r--r--src/nodedef.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nodedef.cpp b/src/nodedef.cpp
index 8a5542837..1dd130ece 100644
--- a/src/nodedef.cpp
+++ b/src/nodedef.cpp
@@ -452,7 +452,12 @@ void ContentFeatures::serialize(std::ostream &os, u16 protocol_version) const
writeU16(os, groups.size());
for (const auto &group : groups) {
os << serializeString16(group.first);
- writeS16(os, group.second);
+ if (group.first.compare("bouncy") == 0) {
+ // Clients may choke on negative bouncy value
+ writeS16(os, abs(group.second));
+ } else {
+ writeS16(os, group.second);
+ }
}
writeU8(os, param_type);
writeU8(os, param_type_2);