From 0a152f0e347f3ef0bc3722686d4b2fe8dac07bcb Mon Sep 17 00:00:00 2001 From: Nunuhara Cabbage Date: Sun, 28 Sep 2025 14:30:17 -0700 Subject: [PATCH] Fix MonsterInfo parsing bug on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For reasons which I can't explain, the string "タイプ = ループ" doesn't work correctly as a format for sscanf on mingw. Instead, we match the exact string including whitespace. --- src/hll/MonsterInfo.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hll/MonsterInfo.c b/src/hll/MonsterInfo.c index 0d6ce4f..f664006 100644 --- a/src/hll/MonsterInfo.c +++ b/src/hll/MonsterInfo.c @@ -179,6 +179,11 @@ static bool parse_monster_info(char *text) current_motion->name = utf2sjis(string_buf, 0); } else if (MATCH("データ = " QUOTED_STRING, string_buf)) { current_motion->data_name = utf2sjis(string_buf, 0); +// XXX: sscanf doesn't match this string on Windows for some reason... +#define LOOP_STR "タイプ\x09\x09= ループ" + } else if (!strncmp(text, LOOP_STR, sizeof(LOOP_STR)-1)) { + text += sizeof(LOOP_STR)-1; + current_motion->type = MOTION_LOOP; } else if (MATCH("タイプ = ループ")) { current_motion->type = MOTION_LOOP; } else if (MATCH("フレーム = %d , %d", &begin, &end)) {