(i_type, I_NONE): shift the enum down 1, so that I_NONE does not need to

be skipped or stored in arrays of size I_MAX. I_NONE's int equivalent
becomes -1 by this patch, so all array indices of type i_type have been
checked not to use I_NONE as index.  This change reduces the size of the
arrays stored in files.
This commit is contained in:
Marc Olzheim 2004-10-12 19:48:53 +00:00
parent 19e4dc57ed
commit 442803c30a
7 changed files with 65 additions and 75 deletions

View file

@ -34,7 +34,6 @@
#include "misc.h"
#include "player.h"
#include "var.h"
#include "sect.h"
#include "xy.h"
#include "nat.h"
@ -78,9 +77,9 @@ sct_prewrite(int id, s_char *ptr)
void
item_prewrite(short *item)
{
int i;
i_type i;
for (i = 0; i <= I_MAX; ++i) {
for (i = I_NONE + 1; i <= I_MAX; ++i) {
if (CANT_HAPPEN(item[i] < 0))
item[i] = 0;
else if (CANT_HAPPEN(item[i] > ITEM_MAX))