mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +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:
parent
258ae99491
commit
5d0b18a0d0
3 changed files with 10 additions and 4 deletions
|
@ -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 (protocol_version < 41 && group.first.compare("bouncy") == 0) {
|
||||
// Old 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue