From: Holger Schemel Date: Sun, 26 Aug 2007 11:09:14 +0000 (+0200) Subject: rnd-20070826-1-src X-Git-Tag: 3.2.4^2~14 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=e2f2a291f575272afe7c2baec23f0e61b067f24a rnd-20070826-1-src * fixed broken editor copy and paste for custom elements between levels --- diff --git a/ChangeLog b/ChangeLog index 750cca4a..bc427113 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2007-08-26 + * fixed broken editor copy and paste for custom elements between levels + 2007-08-25 * title messages are now also searched in graphics artwork directory; those found in graphics directory have precendence over those found diff --git a/src/conftime.h b/src/conftime.h index 433accaa..a006f968 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2007-08-25 16:49" +#define COMPILE_DATE_STRING "2007-08-26 13:07" diff --git a/src/init.c b/src/init.c index 79c3d588..911fc913 100644 --- a/src/init.c +++ b/src/init.c @@ -2605,6 +2605,8 @@ void ResolveGroupElement(int group_element) void InitElementPropertiesStatic() { + static boolean clipboard_elements_initialized = FALSE; + static int ep_diggable[] = { EL_SAND, @@ -4553,9 +4555,12 @@ void InitElementPropertiesStatic() int i, j, k; /* always start with reliable default values (element has no properties) */ + /* (but never initialize clipboard elements after the very first time) */ + /* (to be able to use clipboard elements between several levels) */ for (i = 0; i < MAX_NUM_ELEMENTS; i++) - for (j = 0; j < NUM_ELEMENT_PROPERTIES; j++) - SET_PROPERTY(i, j, FALSE); + if (!IS_CLIPBOARD_ELEMENT(i) || !clipboard_elements_initialized) + for (j = 0; j < NUM_ELEMENT_PROPERTIES; j++) + SET_PROPERTY(i, j, FALSE); /* set all base element properties from above array definitions */ for (i = 0; element_properties[i].elements != NULL; i++) @@ -4573,6 +4578,8 @@ void InitElementPropertiesStatic() /* set static element properties that are not listed in array definitions */ for (i = EL_STEEL_CHAR_START; i <= EL_STEEL_CHAR_END; i++) SET_PROPERTY(i, EP_INDESTRUCTIBLE, TRUE); + + clipboard_elements_initialized = TRUE; } void InitElementPropertiesEngine(int engine_version) @@ -4621,6 +4628,10 @@ void InitElementPropertiesEngine(int engine_version) /* set all special, combined or engine dependent element properties */ for (i = 0; i < MAX_NUM_ELEMENTS; i++) { + /* do not change (already initialized) clipboard elements here */ + if (IS_CLIPBOARD_ELEMENT(i)) + continue; + /* ---------- INACTIVE ------------------------------------------------- */ SET_PROPERTY(i, EP_INACTIVE, ((i >= EL_CHAR_START && i <= EL_CHAR_END) ||