So, I use the Sphere source as reference material in order to keep minisphere's compatibility as high as possible, and I found this gem in the map loading logic:
inline std::string ReadMapString(IFile* file)
{
std::string s;
word length = ReadMapWord(file);
for (int i = 0; i < length; i++)
{
char c;
file->Read(&c, 1);
s += c;
}
return s;
}
It's the function that reads lstrings from an RMP map file. Note that it reads the string
one character at a time. :o
Sorry for the spam, just found this amusing and had to share it!
edit - changed code tag to syntax highlight +neo
Ah, yes. Legacy code. we didnt touch it because it wasnt broken. However, feel free to change it in the main branch.
For good code, check out standard32.c optimal usage of quaternions, iirc.