From: Holger Schemel Date: Thu, 27 Dec 2018 13:24:27 +0000 (+0100) Subject: fixed bug with not saving editor cascade settings for two element groups X-Git-Tag: 4.1.2.0~74 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=33df6c3fc736ac5fdb8283a8677d1a62a22ca9e0;p=rocksndiamonds.git fixed bug with not saving editor cascade settings for two element groups This bug was caused by adding two new element groups to the level editor palette area (for Mirror Magic and Deflektor elements), but not adding them to the list of cascade settings to be saved. The real problem was that two lists were kept in "src/files.c" for the settings, and only one was updated when adding the new cascade groups. To prevent similar bugs in the future, one of the two lists was removed, as those definitions were not used anyway in this case. --- diff --git a/src/files.c b/src/files.c index e9b56ea9..2b89ad89 100644 --- a/src/files.c +++ b/src/files.c @@ -8437,28 +8437,6 @@ enum NUM_EDITOR_SETUP_TOKENS }; -// editor cascade setup -enum -{ - SETUP_TOKEN_EDITOR_CASCADE_BD = 0, - SETUP_TOKEN_EDITOR_CASCADE_EM, - SETUP_TOKEN_EDITOR_CASCADE_EMC, - SETUP_TOKEN_EDITOR_CASCADE_RND, - SETUP_TOKEN_EDITOR_CASCADE_SB, - SETUP_TOKEN_EDITOR_CASCADE_SP, - SETUP_TOKEN_EDITOR_CASCADE_DC, - SETUP_TOKEN_EDITOR_CASCADE_DX, - SETUP_TOKEN_EDITOR_CASCADE_TEXT, - SETUP_TOKEN_EDITOR_CASCADE_STEELTEXT, - SETUP_TOKEN_EDITOR_CASCADE_CE, - SETUP_TOKEN_EDITOR_CASCADE_GE, - SETUP_TOKEN_EDITOR_CASCADE_REF, - SETUP_TOKEN_EDITOR_CASCADE_USER, - SETUP_TOKEN_EDITOR_CASCADE_DYNAMIC, - - NUM_EDITOR_CASCADE_SETUP_TOKENS -}; - // shortcut setup enum { @@ -9293,7 +9271,7 @@ static void decodeSetupFileHash_EditorCascade(SetupFileHash *setup_file_hash) // editor cascade setup seci = setup.editor_cascade; - for (i = 0; i < NUM_EDITOR_CASCADE_SETUP_TOKENS; i++) + for (i = 0; i < ARRAY_SIZE(editor_cascade_setup_tokens); i++) setSetupInfo(editor_cascade_setup_tokens, i, getHashEntry(setup_file_hash, editor_cascade_setup_tokens[i].text)); @@ -9606,7 +9584,7 @@ void SaveSetup_EditorCascade(void) fprintFileHeader(file, EDITORCASCADE_FILENAME); seci = setup.editor_cascade; - for (i = 0; i < NUM_EDITOR_CASCADE_SETUP_TOKENS; i++) + for (i = 0; i < ARRAY_SIZE(editor_cascade_setup_tokens); i++) fprintf(file, "%s\n", getSetupLine(editor_cascade_setup_tokens, "", i)); fclose(file);