From: Holger Schemel Date: Thu, 23 Mar 2023 11:43:03 +0000 (+0100) Subject: fixed sort order for empty elements in dynamic element list in level editor X-Git-Tag: 4.3.5.3~24 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=e79658a32c427476431d8c0c4e47cc3e1aa00be2;p=rocksndiamonds.git fixed sort order for empty elements in dynamic element list in level editor --- diff --git a/src/editor.c b/src/editor.c index 2c46dc65..415b54dc 100644 --- a/src/editor.c +++ b/src/editor.c @@ -5765,14 +5765,18 @@ static void InitDynamicEditorElementList(int **elements, int *num_elements) *num_elements = 0; - // add all elements used in current level (non-custom/group elements) + // add all elements used in current level (non-custom/group/empty elements) for (i = 0; i < NUM_FILE_ELEMENTS; i++) - if (element_found[i] && !(IS_CUSTOM_ELEMENT(i) || IS_GROUP_ELEMENT(i))) + if (element_found[i] && !(IS_CUSTOM_ELEMENT(i) || + IS_GROUP_ELEMENT(i) || + IS_EMPTY_ELEMENT(i))) (*elements)[(*num_elements)++] = i; - // add all elements used in current level (custom/group elements) + // add all elements used in current level (custom/group/empty elements) for (i = 0; i < NUM_FILE_ELEMENTS; i++) - if (element_found[i] && (IS_CUSTOM_ELEMENT(i) || IS_GROUP_ELEMENT(i))) + if (element_found[i] && (IS_CUSTOM_ELEMENT(i) || + IS_GROUP_ELEMENT(i) || + IS_EMPTY_ELEMENT(i))) (*elements)[(*num_elements)++] = i; while (*num_elements % 4) // pad with empty elements, if needed