Page 1 of 1

CSBuild: bug in Import Character Data?

Posted: Mon Nov 22, 2021 8:17 am
by Lux
Hi all.

This is my first post, so big thanks for making DM and CSB live after so many years.

I'm having a look at CSBuild_2019070101 and it seems that the import character data function actually only imports the first three characters.
Be warned, my programming memories go back to when I was playing the game, late 80's :D
But I had a look at an older source code available (from CSBuild3_20src.zip) and in CCSBuildView::OnImportCharacterData it does:

Code: Select all

for (i=0; i<3; i++)
{
	pDoc->ImportChar(i,(CHARDESC *)(temp+i*sizeof(CHARDESC)));
Should'nt that 3 be 4?

BTW, is there some tool to edit the CharacterData.bin file nicely, working on a current Windows 10? I had a look at ADGE, CSBhedit and others, but they all seem to be for older windows versions. For my experiments I can use an hex editor and the CHARDESC struct in types.h, but if there is something friendly, it would be nice imho.

Anyway, thank you again very much.

Re: CSBuild: bug in Import Character Data?

Posted: Mon Nov 22, 2021 12:24 pm
by Gambit37
Welcome to our dusty basement of nostalgia :D

Yeah, that's a good spot, the test should either be i<=3 or i<4, but I'll let more knowledgeable people reply to this just to be sure...

Re: CSBuild: bug in Import Character Data?

Posted: Mon Nov 22, 2021 7:24 pm
by Paul Stevens
You appear to be right. We read four characters from the file but
process only three of them. Hmmmm....can't get everything right the
first time.

I have completely forgotten where I keep my official source code and
what sort of method I use to update and distribute it so that fixes
do not get lost due to disk crashes and such. I will work on rediscovering
all of this. If it is critical to your efforts, I can make a quick, unofficial
binary of a patched CSBuild for you.

Re: CSBuild: bug in Import Character Data?

Posted: Sun Nov 28, 2021 4:52 pm
by Paul Stevens
I think this fixes the Import Character bug:

https://dianneandpaul.net/CSBwin/CSBuild_2021112101.7z

Re: CSBuild: bug in Import Character Data?

Posted: Sun Dec 26, 2021 5:21 pm
by Lux
Hi Paul, I only had time now to look at it. It works, thank you.
Merry Xmax and hope it's going to be happy year:)