From 11d2aca31e80123ec35285dc60c260097e44be6f Mon Sep 17 00:00:00 2001 From: Martin Griffin Date: Sun, 21 Apr 2024 15:47:28 +0100 Subject: [PATCH] TRAINER_BACK_PIC --- tools/trainerproc/main.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/trainerproc/main.c b/tools/trainerproc/main.c index e4bc38ce49f7..51a2df89682c 100644 --- a/tools/trainerproc/main.c +++ b/tools/trainerproc/main.c @@ -143,6 +143,12 @@ static bool is_literal_string(struct String s1, const char *s2) } } +static bool starts_with(struct String s, const char *prefix) +{ + int n = strlen(prefix); + return strncmp((const char *)s.string, prefix, n) == 0; +} + static bool ends_with(struct String s, const char *suffix) { int n = strlen(suffix); @@ -1614,7 +1620,10 @@ static void fprint_trainers(const char *output_path, FILE *f, struct Parsed *par { fprintf(f, "#line %d\n", trainer->pic_line); fprintf(f, " .trainerPic = "); - fprint_constant(f, "TRAINER_PIC", trainer->pic); + if (starts_with(trainer->id, "PARTNER_")) + fprint_constant(f, "TRAINER_BACK_PIC", trainer->pic); + else + fprint_constant(f, "TRAINER_PIC", trainer->pic); fprintf(f, ",\n"); }