Close. The MAX_STATS - 3 thing is fine. Your problem is the one before it. Therefore:

const struct class_type class_table[] =
{
 {
   "mage", "Mag", STAT_INT, {STAT_DIS, STAT_WHATEVER},
   {1,2,3}/*???*/, OBJ_VNUM_SCHOOL_DAGGER,
   {3018, 9618}, 75, 20, 6, 6, 8, TRUE,
   "mage basics", "mage default"
 }
};

Not your:

const struct class_type class_table[MAX_CLASS] =
{
 {
   "mage", "Mag", STAT_INT, STAT_DIS,
   {1,2,3}/*???*/, OBJ_VNUM_SCHOOL_DAGGER,
   {3018, 9618}, 75, 20, 6, 6, 8, TRUE,
   "mage basics", "mage default"
 },



Why?  This:

        sh_int  attr_second[2]; /* Secondary attributes  */

The array means your need 2.

Remember we can initialize arrays like this, even in Java:

int somecrap[5] = {0, 0, 0, 0, 0};

Structs are no different.

Cheers,
-- Jeremy


struct  class_type
{
        char *  name;           /* the full name of the class */
        char    who_name    [4];    /* Three-letter name for 'who'  */
        sh_int  attr_prime;     /* Prime attribute      */
        sh_int  attr_second[2]; /* Secondary attributes  */
        sh_int  stat_priority[MAX_STATS-3]; /* NOT EXPLAINED! */
        sh_int  weapon;         /* First weapon         */
        sh_int  guild[MAX_GUILD];   /* Vnum of guild rooms      */
        sh_int  skill_adept;        /* Maximum skill level      */
        sh_int  thac0_00;       /* Thac0 for level  0       */
        sh_int  thac0_32;       /* Thac0 for level 32       */
        sh_int  hp_min;         /* Min hp gained on leveling    */
        sh_int  hp_max;         /* Max hp gained on leveling    */
        bool    fMana;          /* Class gains mana on level    */
        char *  base_group;     /* base skills gained       */
        char *  default_group;      /* default skills gained    */
};




Reply via email to