diff --git a/d2common/d2data/animation_data.go b/d2common/d2data/animation_data.go index 3a159dfe..3b5c093c 100644 --- a/d2common/d2data/animation_data.go +++ b/d2common/d2data/animation_data.go @@ -37,7 +37,7 @@ func LoadAnimationData(rawData []byte) { for i := 0; i < dataCount; i++ { cofNameBytes := streamReader.ReadBytes(numCofNameBytes) data := &AnimationDataRecord{ - COFName: strings.ReplaceAll(string(cofNameBytes), string(0), ""), + COFName: strings.ReplaceAll(string(cofNameBytes), string(byte(0)), ""), FramesPerDirection: int(streamReader.GetInt32()), AnimationSpeed: int(streamReader.GetInt32()), } diff --git a/d2common/d2data/d2datadict/object_types.go b/d2common/d2data/d2datadict/object_types.go index 4082a0f9..e1d5fefe 100644 --- a/d2common/d2data/d2datadict/object_types.go +++ b/d2common/d2data/d2datadict/object_types.go @@ -32,8 +32,8 @@ func LoadObjectTypes(objectTypeData []byte) { nameBytes := streamReader.ReadBytes(nameSize) tokenBytes := streamReader.ReadBytes(tokenSize) ObjectTypes[i] = ObjectTypeRecord{ - Name: strings.TrimSpace(strings.ReplaceAll(string(nameBytes), string(0), "")), - Token: strings.TrimSpace(strings.ReplaceAll(string(tokenBytes), string(0), "")), + Name: strings.TrimSpace(strings.ReplaceAll(string(nameBytes), string(byte(0)), "")), + Token: strings.TrimSpace(strings.ReplaceAll(string(tokenBytes), string(byte(0)), "")), } } diff --git a/d2common/d2fileformats/d2cof/cof.go b/d2common/d2fileformats/d2cof/cof.go index 855b67ec..7091aaef 100644 --- a/d2common/d2fileformats/d2cof/cof.go +++ b/d2common/d2fileformats/d2cof/cof.go @@ -44,7 +44,7 @@ func Load(fileData []byte) (*COF, error) { layer.Transparent = streamReader.GetByte() != 0 layer.DrawEffect = d2enum.DrawEffect(streamReader.GetByte()) weaponClassStr := streamReader.ReadBytes(4) //nolint:gomnd // Binary data - layer.WeaponClass = d2enum.WeaponClassFromString(strings.TrimSpace(strings.ReplaceAll(string(weaponClassStr), string(0), ""))) + layer.WeaponClass = d2enum.WeaponClassFromString(strings.TrimSpace(strings.ReplaceAll(string(weaponClassStr), string(byte(0)), ""))) result.CofLayers[i] = layer result.CompositeLayers[layer.Type] = i }