mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-02-07 00:56:51 -05:00
Fixed MPQ load issue on french localized D2 (#103)
This commit is contained in:
parent
eaeaf5adb9
commit
ed237307bd
@ -259,8 +259,11 @@ func (v *Engine) LoadFile(fileName string) []byte {
|
||||
if !mpq.FileExists(fileName) {
|
||||
continue
|
||||
}
|
||||
v.Files[fileName] = path.Join(v.Settings.MpqPath, mpqFile)
|
||||
result, _ := mpq.ReadFile(fileName)
|
||||
if len(result) == 0 {
|
||||
continue
|
||||
}
|
||||
v.Files[fileName] = path.Join(v.Settings.MpqPath, mpqFile)
|
||||
return result
|
||||
}
|
||||
log.Fatalf("Could not load %s from MPQs", fileName)
|
||||
|
@ -227,7 +227,7 @@ func (v MPQ) getFileHashEntry(fileName string) (HashTableEntry, error) {
|
||||
func (v MPQ) GetFileBlockData(fileName string) (BlockTableEntry, error) {
|
||||
fileName = strings.ReplaceAll(fileName, "{LANG}", resourcepaths.LanguageCode)
|
||||
fileEntry, err := v.getFileHashEntry(fileName)
|
||||
if err != nil {
|
||||
if err != nil || fileEntry.BlockIndex >= uint32(len(v.BlockTableEntries)) {
|
||||
return BlockTableEntry{}, err
|
||||
}
|
||||
return v.BlockTableEntries[fileEntry.BlockIndex], nil
|
||||
|
Loading…
Reference in New Issue
Block a user