Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

Too many HCs crashes ZC (very minor)

3 replies · 18,632 views · Started 23 April 2016

I was testing a scripted boss for my quest, decided to max out my HP via cheat menu. Wasn't sure on the cap, so i just added 999999 HCs, expecting that it would either auto-cap it to the max the engine could handle, or return an error telling me to make the number an integer between 1 and whatever the cap is. Instead it gave me this:

User posted image

Then promptly crashed. I doubt anyone will ever cause this error during an actual playthrough, but yeah, it's there. Whether I hit abort, retry or ignore, it crashes. "This program has stopped working." with the options to either close the program, or search online, then close the program.

Take note when you set Heart Containers your probably setting HP too. 16 HP per HC.
999999 * 16 = 15999984

Yeah of course it would crash. That goes beyond the max for the type HP uses.

Programming 101, if assigning a value to a dialog box crashes the program, you auto-cap the max integer or otherwise prevent the dialogue box from assigning a number it can't handle. You see it all the time, even in ZC and ZQ "Please use a number between 1-255(or whatever the maximum integer the system can handle)". Not including something that prevents crashing in these situations is a bug, it is a failure in the program's design. Now, if you want to point out that it's a very *minor* bug that most people will never come across, and thus isn't high priority, that's a fair point, but to act like it should be an expected aspect of the program is just asinine and lazy.

Turns out it does cap the value, just not quite correctly. It caps the value at 65536 HP, which in an unsigned short int becomes 0, causing a subsequent assert(low<=high) to fail.
Fixed.