Background addition

This commit is contained in:
kinther 2025-12-14 14:26:09 -08:00
parent 2e1d7816f6
commit 4f2e68a369
13 changed files with 202 additions and 41 deletions

View file

@ -334,7 +334,8 @@ int load_char(const char *name, struct char_data *ch)
break;
case 'B':
if (!strcmp(tag, "Badp")) GET_BAD_PWS(ch) = atoi(line);
if (!strcmp(tag, "Back")) ch->player.background = fread_string(fl, buf2);
else if (!strcmp(tag, "Badp")) GET_BAD_PWS(ch) = atoi(line);
else if (!strcmp(tag, "Bank")) GET_BANK_GOLD(ch) = atoi(line);
else if (!strcmp(tag, "Brth")) ch->player.time.birth = atol(line);
break;
@ -585,6 +586,11 @@ void save_char(struct char_data * ch)
strip_cr(buf);
fprintf(fl, "Desc:\n%s~\n", buf);
}
if (ch->player.background && *ch->player.background) {
strcpy(buf, ch->player.background);
strip_cr(buf);
fprintf(fl, "Back:\n%s~\n", buf);
}
if (POOFIN(ch)) fprintf(fl, "PfIn: %s\n", POOFIN(ch));
if (POOFOUT(ch)) fprintf(fl, "PfOt: %s\n", POOFOUT(ch));
if (GET_SEX(ch) != PFDEF_SEX) fprintf(fl, "Sex : %d\n", GET_SEX(ch));