CSBuild: bug in Import Character Data?

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
Lux
Neophyte
Posts: 2
Joined: Mon Nov 22, 2021 7:26 am

CSBuild: bug in Import Character Data?

Post 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.
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: CSBuild: bug in Import Character Data?

Post 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...
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: CSBuild: bug in Import Character Data?

Post 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.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: CSBuild: bug in Import Character Data?

Post by Paul Stevens »

I think this fixes the Import Character bug:

https://dianneandpaul.net/CSBwin/CSBuild_2021112101.7z
Lux
Neophyte
Posts: 2
Joined: Mon Nov 22, 2021 7:26 am

Re: CSBuild: bug in Import Character Data?

Post 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:)
Post Reply

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”