mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-02-20 23:47:16 -05:00
Check if MPQ file was loaded before reading. (#125)
And if it wasn't then tell the user which one instead of crashing.
This commit is contained in:
parent
4aba58eb28
commit
948ca1fc1a
@ -109,6 +109,9 @@ func (v *Engine) LoadFile(fileName string) []byte {
|
||||
}
|
||||
for _, mpqFile := range v.Settings.MpqLoadOrder {
|
||||
archive, _ := mpq.Load(path.Join(v.Settings.MpqPath, mpqFile))
|
||||
if archive == nil {
|
||||
log.Fatalf("Failed to load specified MPQ file: %s", mpqFile)
|
||||
}
|
||||
if !archive.FileExists(fileName) {
|
||||
continue
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user