PDA

View Full Version : display_resistance_panel f array


PaulBlay
April 9, 2009, 10:24
In files.c I noticed

u32b f[4] = {0, 0, 0, 0};
...
object_flags_known(o_ptr, &f[1], &f[2], &f[3]);

Just wondering why that isn't

u32b f[3] = {0, 0, 0};
...
object_flags_known(o_ptr, &f[0], &f[1], &f[2]);

:confused:

[EDIT] Never mind, I suppose it's so that things like
f[1] |= (TR1_INFRA);
are more understandable.

takkaria
April 9, 2009, 11:49
In files.c I noticed

u32b f[4] = {0, 0, 0, 0};
...
object_flags_known(o_ptr, &f[1], &f[2], &f[3]);

Just wondering why that isn't

u32b f[3] = {0, 0, 0};
...
object_flags_known(o_ptr, &f[0], &f[1], &f[2]);

:confused:

[EDIT] Never mind, I suppose it's so that things like
f[1] |= (TR1_INFRA);
are more understandable.

Yeah, I imagine that'd why that was done. I intend to switch from flags1/2/3 to a flags array at some point fairly soon, at which point TR1_ will become TR0_ and so forth.