objects[] infrastructure
The bases[] array allows finding the index of the first object in a particular class. Extend it so that bases[class + 1] - 1 is a reliable way to find the last object in any class. The array had to be extended by one so that the last class has a [class+1] entry available, and object initialization now makes sure that classes within objects[] are in ascending order so that [class+1] always holds a higher index than [class].
This commit is contained in:
@@ -713,7 +713,7 @@ struct instance_globals {
|
||||
const char *hname; /* name of the game (argv[0] of main) */
|
||||
int hackpid; /* current process id */
|
||||
char chosen_windowtype[WINTYPELEN];
|
||||
int bases[MAXOCLASSES];
|
||||
int bases[MAXOCLASSES + 1];
|
||||
int multi;
|
||||
const char *multi_reason;
|
||||
int nroom;
|
||||
|
||||
Reference in New Issue
Block a user