display_resistance_panel f array

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PaulBlay
    Knight
    • Jan 2009
    • 657

    display_resistance_panel f array

    In files.c I noticed

    Code:
    u32b f[4] = {0, 0, 0, 0};
    ...
    object_flags_known(o_ptr, &f[1], &f[2], &f[3]);
    Just wondering why that isn't

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


    [EDIT] Never mind, I suppose it's so that things like
    Code:
    f[1] |= (TR1_INFRA);
    are more understandable.
    Currently turning (Angband) Japanese.
  • takkaria
    Veteran
    • Apr 2007
    • 1951

    #2
    Originally posted by PaulBlay
    In files.c I noticed

    Code:
    u32b f[4] = {0, 0, 0, 0};
    ...
    object_flags_known(o_ptr, &f[1], &f[2], &f[3]);
    Just wondering why that isn't

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


    [EDIT] Never mind, I suppose it's so that things like
    Code:
    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.
    takkaria whispers something about options. -more-

    Comment

    Working...
    😀
    😂
    🥰
    😘
    🤢
    😎
    😞
    😡
    👍
    👎