Revert "Plantlike visual scale: Send sqrt(visual_scale) to old clients"

This reverts commit cdc538e0a2.
master
Craig Robbins 2017-02-10 22:21:23 +10:00
parent f5d4494a51
commit 7bd3e2bceb
2 changed files with 3 additions and 9 deletions

View File

@ -146,8 +146,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
PROTOCOL VERSION 30: PROTOCOL VERSION 30:
New ContentFeatures serialization version New ContentFeatures serialization version
Add node and tile color and palette Add node and tile color and palette
Fix plantlike visual_scale being applied squared and add compatibility
with pre-30 clients by sending sqrt(visual_scale)
*/ */
#define LATEST_PROTOCOL_VERSION 30 #define LATEST_PROTOCOL_VERSION 30

View File

@ -1611,10 +1611,6 @@ void ContentFeatures::serializeOld(std::ostream &os, u16 protocol_version) const
compatible_param_type_2 = CPT2_WALLMOUNTED; compatible_param_type_2 = CPT2_WALLMOUNTED;
} }
float compatible_visual_scale = visual_scale;
if (protocol_version < 30 && drawtype == NDT_PLANTLIKE)
compatible_visual_scale = sqrt(visual_scale);
if (protocol_version == 13) if (protocol_version == 13)
{ {
writeU8(os, 5); // version writeU8(os, 5); // version
@ -1626,7 +1622,7 @@ void ContentFeatures::serializeOld(std::ostream &os, u16 protocol_version) const
writeS16(os, i->second); writeS16(os, i->second);
} }
writeU8(os, drawtype); writeU8(os, drawtype);
writeF1000(os, compatible_visual_scale); writeF1000(os, visual_scale);
writeU8(os, 6); writeU8(os, 6);
for (u32 i = 0; i < 6; i++) for (u32 i = 0; i < 6; i++)
tiledef[i].serialize(os, protocol_version); tiledef[i].serialize(os, protocol_version);
@ -1674,7 +1670,7 @@ void ContentFeatures::serializeOld(std::ostream &os, u16 protocol_version) const
writeS16(os, i->second); writeS16(os, i->second);
} }
writeU8(os, drawtype); writeU8(os, drawtype);
writeF1000(os, compatible_visual_scale); writeF1000(os, visual_scale);
writeU8(os, 6); writeU8(os, 6);
for (u32 i = 0; i < 6; i++) for (u32 i = 0; i < 6; i++)
tiledef[i].serialize(os, protocol_version); tiledef[i].serialize(os, protocol_version);
@ -1728,7 +1724,7 @@ void ContentFeatures::serializeOld(std::ostream &os, u16 protocol_version) const
writeS16(os, i->second); writeS16(os, i->second);
} }
writeU8(os, drawtype); writeU8(os, drawtype);
writeF1000(os, compatible_visual_scale); writeF1000(os, visual_scale);
writeU8(os, 6); writeU8(os, 6);
for (u32 i = 0; i < 6; i++) for (u32 i = 0; i < 6; i++)
tiledef[i].serialize(os, protocol_version); tiledef[i].serialize(os, protocol_version);