From: Holger Schemel Date: Sun, 20 Aug 2023 11:38:15 +0000 (+0200) Subject: fixed bugs when parsing global animation parameter values X-Git-Tag: 4.3.7.0~29 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=a0d9cd0bdd01d7e9b5c3086bea3b573987b4a84f fixed bugs when parsing global animation parameter values The previous code recognized the value "click" in the parameter string "click,click:anim_X", but did not in string "click:anim_X,click". --- diff --git a/src/files.c b/src/files.c index 77fe2cdb..11f4c142 100644 --- a/src/files.c +++ b/src/files.c @@ -11527,8 +11527,9 @@ static boolean string_has_parameter(char *s, char *s_contained) char next_char = s[strlen(s_contained)]; // check if next character is delimiter or whitespace - return (next_char == ',' || next_char == '\0' || - next_char == ' ' || next_char == '\t' ? TRUE : FALSE); + if (next_char == ',' || next_char == '\0' || + next_char == ' ' || next_char == '\t') + return TRUE; } // check if string contains another parameter string after a comma @@ -11741,13 +11742,8 @@ static int get_anim_parameter_values(char *s) // if animation event found, add it to global animation event list if (event_value != ANIM_EVENT_NONE) - { list_pos = AddGlobalAnimEventValue(list_pos, event_value); - // continue with next part of the string, starting with next comma - s = strchr(s + 1, ','); - } - while (s != NULL) { // add optional "click:anim_X" or "click:anim_X.part_X" parameter