Page 1 of 1

Empty book's title and author is 0

Posted: Fri Aug 15, 2008 12:42 pm
by ncrsn
Very minor stuff, just accidentally ran across: empty book's title and author is "0" instead of being empty.

Codewise it is be caused by book methodscript's function GetInfo (or better, the usage of it), in where various book related info is searched from datafiles, cprops and itemdesc.cfg, and if not found in any of them, value 0 is returned, causing it to appear as title and author.

This patch will add few if-blocks to convert zero with emptiness.

Posted: Fri Aug 15, 2008 10:13 pm
by Madman
Not sure if anyone's applied this yet, but if not I'll do it tonight if I can get my SVN of the distro to work. Grr.

Posted: Fri Aug 15, 2008 10:34 pm
by Madman
Actually, applied it with one minor change- the original code had a CStr which yours eliminated. I don't know for certain whether your removal was deliberate, so I modified the return statements to be

return CStr(author);

etc. I figure it can't hurt.

Posted: Fri Aug 15, 2008 11:19 pm
by ncrsn
You did the right thing, now that I think about it. Never knows what type of data is saved.

Thanks for acting fast.