diff --git a/character.c b/character.c index 9c95e8a..9108545 100644 --- a/character.c +++ b/character.c @@ -333,19 +333,17 @@ void genBackground(){ } size_t genChar(char* output, size_t maxlen){ + int i; profs = 0; languages = 0; - for(int i = 0; i <= 100; i++){ - otherprofs[i] = '\0'; - } - int i; - genRace(); - genClass(); - genBackground(); + otherprofs[0] = '\0'; for(i=0; i < 6; i++){ stats[i] = dieroll(3,6); mods[i] = (stats[i]/2)-5; } + genRace(); + genClass(); + genBackground(); snprintf(output, maxlen, "Race = %s\r\nBackground = %s\r\nClass = %s\r\nStr = %d %d\r\nDex = %d %d\r\nCon = %d %d\r\nInt = %d %d\r\nWis = %d %d\r\nCha = %d %d\r\n\r\nHP: %d\r\n", race, background, class, stats[STR], mods[STR], stats[DEX], mods[DEX], stats[CON], mods[CON], stats[INT], mods[INT], stats[WIS], mods[WIS], stats[CHA], mods[CHA], hp);