#3311: Fix chat handling on older versions

This commit is contained in:
md_5 2022-06-08 08:30:37 +10:00
parent cc4765b4fe
commit fc8685a042
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -596,10 +596,6 @@ public enum Protocol
{ {
// Mapping is non current, but the next one may be ok // Mapping is non current, but the next one may be ok
ProtocolMapping nextMapping = mappings[mappingIndex + 1]; ProtocolMapping nextMapping = mappings[mappingIndex + 1];
if ( nextMapping.packetID < 0 )
{
break;
}
if ( nextMapping.protocolVersion == protocol ) if ( nextMapping.protocolVersion == protocol )
{ {
@ -610,6 +606,11 @@ public enum Protocol
} }
} }
if ( mapping.packetID < 0 )
{
break;
}
ProtocolData data = protocols.get( protocol ); ProtocolData data = protocols.get( protocol );
data.packetMap.put( packetClass, mapping.packetID ); data.packetMap.put( packetClass, mapping.packetID );
data.packetConstructors[mapping.packetID] = constructor; data.packetConstructors[mapping.packetID] = constructor;