Drake53 / War3Net

A .NET implementation of Warcraft III related libraries.
MIT License
123 stars 27 forks source link

increasing MpqTable.MaxSize? #14

Closed IceReaper closed 3 years ago

IceReaper commented 3 years ago

Any reason this is limited to 0x1 << 16 ? When packing a larger MPQ archive, i exceed this amount quite quickly by having a bigger HashTable. Reading an mpq archive also reads it as int32.

IceReaper commented 3 years ago

After some testing, it seems its not a good idea to make this value larger -> resulting mpqs are broken. Anyway, i wonder why War3Net generates a huge HashTable for newly created MPQ archives.

IceReaper commented 3 years ago

Okay, got it fixed by specifying a default hashtable size. It might be a good idea to use a Max.Min() with the maximum table size, where the filecount * 8 is used, so when having more then 0x1 << 13 files, this wont produce a crash.