From ff3e855a464d4ee5893d2793768c1041fcc3c80f Mon Sep 17 00:00:00 2001 From: Nikita <11695747+MoofMonkey@users.noreply.github.com> Date: Sun, 8 Dec 2019 23:19:47 +0300 Subject: [PATCH] Fixed relative StringTables indexes --- string_table.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/string_table.go b/string_table.go index f475007c..ca759243 100644 --- a/string_table.go +++ b/string_table.go @@ -201,14 +201,12 @@ func parseStringTable(buf []byte, numUpdates int32, name string, userDataFixed b value := []byte{} // Read a boolean to determine whether the operation is an increment or - // has a fixed index position. A fixed index position of zero should be + // has a relative index position. A fixed index position of zero should be // the last data in the buffer, and indicates that all data has been read. - incr := r.readBoolean() - if incr { - index++ - } else { - index = int32(r.readVarUint32()) + 1 + if !r.readBoolean() { + index += int32(r.readVarUint32()) + 1 } + index++ // Some values have keys, some don't. hasKey := r.readBoolean()