<clip>
GEN_DATA *new_gen_data(void)
{
GEN_DATA *gen;
if (gen_data_free == NULL)
gen = alloc_perm(sizeof(*gen));
else
{
gen = gen_data_free;
gen_data_free = gen_data_free->next;
}
+#if defined( FIRST_BOOT )
VALIDATE( gen );
+#else
+ gen->group_chosen = ( bool * ) malloc( sizeof(
bool ) * MAX_GROUP );
+ gen->group_chosen[MAX_GROUP-1] = 0;
+ gen->skill_chosen = ( bool * ) malloc( sizeof(
bool ) * MAX_SKILL );
+ gen->skill_chosen[MAX_SKILL-1] = 0;
+ VALIDATE(gen);
+#endif
return gen;
}
</clip>
Except when I customize I have no choices, and it ends
up giving me beguiling, attack, and then tons of
spells that aren't in either group, along with most of
the skills.
I don't know why everyone is avoiding the actual question/problem here.
What he has to do is initialize the memory he is malloc()ing. Memset(
gen->group_chosen, 0, sizeof( (bool)*MAX_GROUP ) ); etc works or just
use a simple for loop. This will solve all these skills/spells/groups he
'magically' gets each time he customizes.
Ammaross Danan
Ardenmore
http://www.ardenmore.com