X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_bd%2Fbd_bdcff.c;h=9972b7f2b9a4e0309002690d4ede7cccc2aa9da7;hb=ec529b5df69b376a1d55e38862975b7d9a26ea97;hp=19cfc2d7cced2cc99fbe918f72280840a2a9d695;hpb=7fb08abe58b2c84e36a5ed247d2103e08ae98aa4;p=rocksndiamonds.git diff --git a/src/game_bd/bd_bdcff.c b/src/game_bd/bd_bdcff.c index 19cfc2d7..9972b7f2 100644 --- a/src/game_bd/bd_bdcff.c +++ b/src/game_bd/bd_bdcff.c @@ -82,7 +82,7 @@ static boolean replay_store_from_bdcff(GdReplay *replay, const char *str) break; default: - if (g_ascii_isdigit(str[i])) + if (str[i] >= '0' && str[i] <= '9') { if (!num) num = str + i; @@ -150,7 +150,7 @@ static boolean struct_set_property(gpointer str, const GdStructDescriptor *prop_ int i; boolean was_string; - params = g_strsplit_set(param, " ", -1); + params = getSplitStringArray(param, " ", -1); paramcount = g_strv_length(params); identifier_found = FALSE; @@ -330,7 +330,7 @@ static boolean struct_set_property(gpointer str, const GdStructDescriptor *prop_ if (identifier_found && !was_string && paramindex < paramcount) Warn("excess parameters for attribute '%s': '%s'", attrib, params[paramindex]); - g_strfreev(params); + freeStringArray(params); return identifier_found; } @@ -347,12 +347,12 @@ static boolean replay_store_more_from_bdcff(GdReplay *replay, const char *param) int i; boolean result = TRUE; - split = g_strsplit_set(param, " ", -1); + split = getSplitStringArray(param, " ", -1); for (i = 0; split[i] != 0; i++) result = result && replay_store_from_bdcff(replay, split[i]); - g_strfreev(split); + freeStringArray(split); return result; } @@ -403,7 +403,7 @@ static boolean cave_process_tags_func(const char *attrib, const char *param, GdC char **params; boolean identifier_found; - params = g_strsplit_set(param, " ", -1); + params = getSplitStringArray(param, " ", -1); identifier_found = FALSE; if (strcasecmp(attrib, "SnapExplosions") == 0) @@ -482,7 +482,7 @@ static boolean cave_process_tags_func(const char *attrib, const char *param, GdC identifier_found = struct_set_property(cave, gd_cave_properties, attrib, param, cave->w * cave->h); } - g_strfreev(params); + freeStringArray(params); /* a ghrfunc should return true if the identifier is to be removed */ return identifier_found; @@ -669,7 +669,7 @@ boolean gd_caveset_load_from_bdcff(const char *contents) replay_tags = g_hash_table_new_full(gd_str_case_hash, gd_str_case_equal, free, free); /* split into lines */ - lines = g_strsplit_set (contents, "\n", 0); + lines = getSplitStringArray (contents, "\n", 0); /* attributes read will be set in cave. if no [cave]; they are stored in the default cave; like in a [game] */ @@ -1048,7 +1048,7 @@ boolean gd_caveset_load_from_bdcff(const char *contents) /* CHECK IF IT IS AN EFFECT */ char **params; - params = g_strsplit_set(param, " ", -1); + params = getSplitStringArray(param, " ", -1); /* an effect command has two parameters */ if (g_strv_length(params) == 2) @@ -1095,7 +1095,7 @@ boolean gd_caveset_load_from_bdcff(const char *contents) else Warn("invalid effect specification '%s'", param); - g_strfreev(params); + freeStringArray(params); } else { @@ -1149,7 +1149,7 @@ boolean gd_caveset_load_from_bdcff(const char *contents) Warn(_("Invalid BDCFF: [game] section has drawing objects defined")); /* cleanup */ - g_strfreev (lines); + freeStringArray(lines); g_hash_table_destroy(tags); g_hash_table_destroy(replay_tags); gd_cave_free(default_cave);