Skip to content

MessageBox formatting is too limited

As discovered in !4867 (comment 2701070063), our implementation of MessageBox formatting doesn't match Morrowind.exe's.

The original engine appears to use sprintf to handle format arguments, meaning any format specifiers accepted by the compiler they were using can be used. Not all types work, presumably because the actual values are passed as floats. This means s, S, F, d, and i either crash or only produce 0s.

We currently expect the format flags to be presented in a specific order, we lack support for +, -, and #, and we don't really treat them as flags at all.