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

Possible Out of Bounds Bug with Game->GetData [1108]

2 replies · 1,089 views · Started 05 December 2009

In windows build 1099 and build 1108, Game->GetComboData(0, 0, 0) or Game->GetComboCSet(0, 0, 0) may cause a crash when the map parameter is 0. This is easily seen in this quest:

http://www.mediafire.com/file/zyll0kh2vmm/ZCGDemo003.qst

This quest runs fine in build 1074. In build 1099 and 1108, running neary any instance of Game->GetComboData or Game->GetComboCSet will instantly crash the player because the map accessed is 0. Adding 1 or more to all the map parameters prevents the crash, but the workaround makes accessing the first map impossible.

Minor expirementing has revealed that not every instance of this causes a crash, but the value returned, when displayed with Trace(), is not the correct value of the combo accessed. It is most likely certain values for the screen parameter cause the crash, while others return from the wrong location.

Note: If 1 is supposed to be the minimum value for the map parameter, make the map accessed one less than it currently is (0 is the first map, 1 is the second map, etc).

Yeah, I had posted this before the forum shenanigans. To be honest I'm not completely sure what to do about it. I suppose simply tweaking the zscript functions that take a map parameter by having them output a map number that matches what is displayed in zquest regardless of the actual internal indice would work fine, along the same for arguments (eg; maps start at 1, dmaps 0). I'm not so keen on the relabeling option however, as that would be a nightmare to sort out properly. A fine mess, to be sure.

What do you guys think?

Fixed in 1122. But I ought to sanitise the routines in case someone does put 0 into it.