1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-09-01 00:44:19 -04:00

de-normalize file name before searching in MPQ (#87)

This was actually fixed by @essial.
Fixes #86.
This commit is contained in:
Robin Eklind 2019-11-05 17:29:02 -06:00 committed by Tim Sarbin
parent c84698400b
commit 4a24fc0b8c

View File

@ -2,6 +2,7 @@ package Core
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"math"
@ -9,7 +10,6 @@ import (
"path"
"strings"
"sync"
"fmt"
"github.com/OpenDiablo2/OpenDiablo2/PaletteDefs"
@ -195,7 +195,7 @@ func (v *Engine) LoadFile(fileName string) []byte {
if err != nil {
continue
}
if !mpq.FileExists(fileName) {
if !mpq.FileExists(strings.ToLower(strings.ReplaceAll(strings.ReplaceAll(fileName, "/data", "data"), "/", `\`))) {
continue
}
// We found the super-secret file!