From c3ace103c6339887c400e5d7fdfb56fee754a9ae Mon Sep 17 00:00:00 2001 From: ORelio Date: Thu, 13 Aug 2020 23:05:23 +0200 Subject: [PATCH] Fix crash on MC 1.7 update score (#1199) --- MinecraftClient/Protocol/Handlers/Protocol18.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MinecraftClient/Protocol/Handlers/Protocol18.cs b/MinecraftClient/Protocol/Handlers/Protocol18.cs index 8f34c4bc..a9f67407 100644 --- a/MinecraftClient/Protocol/Handlers/Protocol18.cs +++ b/MinecraftClient/Protocol/Handlers/Protocol18.cs @@ -921,12 +921,12 @@ namespace MinecraftClient.Protocol.Handlers case PacketIncomingType.UpdateScore: string entityname = dataTypes.ReadNextString(packetData); byte action3 = dataTypes.ReadNextByte(packetData); - string objectivename2 = dataTypes.ReadNextString(packetData); + string objectivename2 = null; int value = -1; + if (action3 != 1 || protocolversion >= MC18Version) + objectivename2 = dataTypes.ReadNextString(packetData); if (action3 != 1) - { value = dataTypes.ReadNextVarInt(packetData); - } handler.OnUpdateScore(entityname, action3, objectivename2, value); break; default: