Dix off-by-one errors induced by tightening some array bounds.
This commit is contained in:
parent
8a3757df59
commit
d809974479
2 changed files with 12 additions and 13 deletions
9
init.c
9
init.c
|
@ -38,11 +38,10 @@ void initialise(void)
|
|||
* This also sets up "game.place" and "fixed" as copies of "PLAC" and
|
||||
* "FIXD". Also, since two-placed objects are typically best
|
||||
* described last, we'll drop them first. */
|
||||
for (int i = 1; i <= NOBJECTS; i++) {
|
||||
int k = NOBJECTS + 1 - i;
|
||||
if (object_descriptions[k].fixd > 0) {
|
||||
DROP(k + NOBJECTS, object_descriptions[k].fixd);
|
||||
DROP(k, object_descriptions[k].plac);
|
||||
for (int i = NOBJECTS; i >= 1; i--) {
|
||||
if (object_descriptions[i].fixd > 0) {
|
||||
DROP(i + NOBJECTS, object_descriptions[i].fixd);
|
||||
DROP(i, object_descriptions[i].plac);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue