From: Holger Schemel Date: Tue, 30 Apr 2024 22:40:42 +0000 (+0200) Subject: moved code to separate function X-Git-Tag: 4.4.0.0-test-1~20 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=46cca8c7efab20f43ded5a37ffe10647f5a80c47;p=rocksndiamonds.git moved code to separate function --- diff --git a/src/files.c b/src/files.c index 451edb8b..278938ab 100644 --- a/src/files.c +++ b/src/files.c @@ -2675,13 +2675,18 @@ static void ActivateLevelTemplate(void) } } +boolean isLevelsetFilename_BD(char *filename) +{ + return (strSuffixLower(filename, ".bd") || + strSuffixLower(filename, ".bdr") || + strSuffixLower(filename, ".brc") || + strSuffixLower(filename, ".gds")); +} + static boolean checkForPackageFromBasename_BD(char *basename) { // check for native BD level file extensions - if (!strSuffixLower(basename, ".bd") && - !strSuffixLower(basename, ".bdr") && - !strSuffixLower(basename, ".brc") && - !strSuffixLower(basename, ".gds")) + if (!isLevelsetFilename_BD(basename)) return FALSE; // check for standard single-level BD files (like "001.bd") diff --git a/src/files.h b/src/files.h index 8301b781..aab1da88 100644 --- a/src/files.h +++ b/src/files.h @@ -29,6 +29,7 @@ void setElementChangePages(struct ElementInfo *, int); void setElementChangeInfoToDefaults(struct ElementChangeInfo *); void copyElementInfo(struct ElementInfo *, struct ElementInfo *); +boolean isLevelsetFilename_BD(char *); char *getDefaultLevelFilename(int); char *getLocalLevelTemplateFilename(void); char *getGlobalLevelTemplateFilename(void);