There's a very unimportant bug that's been getting on my nerves and it involves a piece of code which is gibberish to me so I'm asking for help:
The "C" line in p_race text lists recommended classes for that race. The recommended classes show up in a brighter color in the birth menu, but this doesn't work. No recommended classes below the alchemist (class index 7) ever show up in a brighter color.
The relevant piece of code (I think) is this little function in birth.c
I have no idea what (1L << oid) means so I can't fix the bug.
I looked in init.c where it reads the C: line in p_race.txt and it uses a similar thing:
Does this put a limit on how many C: entries there can be?
"atoi" isn't defined as a function anywhere so I assume it's an innate C thing that I haven't learned.
The "C" line in p_race text lists recommended classes for that race. The recommended classes show up in a brighter color in the birth menu, but this doesn't work. No recommended classes below the alchemist (class index 7) ever show up in a brighter color.
The relevant piece of code (I think) is this little function in birth.c
Code:
/* CLASS */ static void display_class(menu_type *menu, int oid, bool cursor, int row, int col, int width) { byte attr = curs_attrs[0 != (rp_ptr->choice & (1L << oid))][0 != cursor]; c_put_str(attr, c_name + c_info[oid].name, row, col); }
I looked in init.c where it reads the C: line in p_race.txt and it uses a similar thing:
Code:
/* Hack - Parse this entry */ pr_ptr->choice |= (1 << atoi(s));
"atoi" isn't defined as a function anywhere so I assume it's an innate C thing that I haven't learned.
Comment