rnd-20060604-1-src
authorHolger Schemel <info@artsoft.org>
Sun, 4 Jun 2006 00:05:45 +0000 (02:05 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:52:01 +0000 (10:52 +0200)
* fixed bug with player exploding when moving into acid
* fixed bug with level settings being reset in editor and when playing
  (some compatibility settings being set not only after level loading)

ChangeLog
src/conftime.h
src/files.c
src/game.c

index 4594e02d19ff896086cfea94025279cc4f3d8b56..fbbf09c9cb0602cc1cd33dbb83e38c79fbff28be 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2006-06-03
+       * fixed bug with player exploding when moving into acid
+       * fixed bug with level settings being reset in editor and when playing
+         (some compatibility settings being set not only after level loading)
        * fixed crash bug when number of custom graphic frames was set to zero
+       * fixed bug with teleporting player on walkable tile not working anymore
+       * added partial compatibility support for pre-release-only "CONF" chunk
+         (to make Alan Bond's "color cycle" demo work again :-) )
 
 2006-05-30
        * fixed some bugs when displaying title screens from info screen menu
index 91a94f889ddbd827e9c736e686b87647fe3cc47c..183e04a9b641b35eebb1c68cdb0fcd0354022e57 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-06-03 20:34]"
+#define COMPILE_DATE_STRING "[2006-06-04 01:42]"
index 5f5b1fbb0517d71c2c03b5a089a4c79c36d3cde2..0395afae669525f711ececc669caacf1678cf3a4 100644 (file)
@@ -1139,6 +1139,61 @@ static struct LevelFileConfigInfo chunk_config_GRPX[] =
   },
 };
 
+static struct LevelFileConfigInfo chunk_config_CONF[] =                /* (OBSOLETE) */
+{
+  {
+    EL_PLAYER_1,                       -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(9),
+    &li.block_snap_field,              TRUE
+  },
+  {
+    EL_PLAYER_1,                       -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(13),
+    &li.continuous_snapping,           TRUE
+  },
+  {
+    EL_PLAYER_1,                       -1,
+    TYPE_INTEGER,                      CONF_VALUE_8_BIT(1),
+    &li.initial_player_stepsize[0],    STEPSIZE_NORMAL
+  },
+  {
+    EL_PLAYER_1,                       -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(10),
+    &li.use_start_element[0],          FALSE
+  },
+  {
+    EL_PLAYER_1,                       -1,
+    TYPE_ELEMENT,                      CONF_VALUE_16_BIT(1),
+    &li.start_element[0],              EL_PLAYER_1
+  },
+  {
+    EL_PLAYER_1,                       -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(11),
+    &li.use_artwork_element[0],                FALSE
+  },
+  {
+    EL_PLAYER_1,                       -1,
+    TYPE_ELEMENT,                      CONF_VALUE_16_BIT(2),
+    &li.artwork_element[0],            EL_PLAYER_1
+  },
+  {
+    EL_PLAYER_1,                       -1,
+    TYPE_BOOLEAN,                      CONF_VALUE_8_BIT(12),
+    &li.use_explosion_element[0],      FALSE
+  },
+  {
+    EL_PLAYER_1,                       -1,
+    TYPE_ELEMENT,                      CONF_VALUE_16_BIT(3),
+    &li.explosion_element[0],          EL_PLAYER_1
+  },
+
+  {
+    -1,                                        -1,
+    -1,                                        -1,
+    NULL,                              -1,
+  },
+};
+
 static struct
 {
   int filetype;
@@ -3010,6 +3065,28 @@ static int LoadLevel_INFO(FILE *file, int chunk_size, struct LevelInfo *level)
   return real_chunk_size;
 }
 
+static int LoadLevel_CONF(FILE *file, int chunk_size, struct LevelInfo *level)
+{
+  int real_chunk_size = 0;
+
+  li = *level;         /* copy level data into temporary buffer */
+
+  while (!feof(file))
+  {
+    int element = getMappedElement(getFile16BitBE(file));
+
+    real_chunk_size += 2;
+    real_chunk_size += LoadLevel_MicroChunk(file, chunk_config_CONF,
+                                           element, element);
+    if (real_chunk_size >= chunk_size)
+      break;
+  }
+
+  *level = li;         /* copy temporary buffer back to level data */
+
+  return real_chunk_size;
+}
+
 static int LoadLevel_ELEM(FILE *file, int chunk_size, struct LevelInfo *level)
 {
   int real_chunk_size = 0;
@@ -3358,6 +3435,7 @@ static void LoadLevelFromFileInfo_RND(struct LevelInfo *level,
       { "CUS3", -1,                    LoadLevel_CUS3 },
       { "CUS4", -1,                    LoadLevel_CUS4 },
       { "GRP1", -1,                    LoadLevel_GRP1 },
+      { "CONF", -1,                    LoadLevel_CONF },
       { "ELEM", -1,                    LoadLevel_ELEM },
       { "NOTE", -1,                    LoadLevel_NOTE },
       { "CUSX", -1,                    LoadLevel_CUSX },
index ed436b4ab836241c9c2149c7f9b6cd17b493924a..7cf63d089f34368823121b951f2c736b1cea5fb7 100644 (file)
@@ -8450,8 +8450,10 @@ static void CreateFieldExt(int x, int y, int element, boolean is_change)
 #if USE_NEW_CUSTOM_VALUE
   int last_ce_value = CustomValue[x][y];
 #endif
-  boolean add_player = (ELEM_IS_PLAYER(new_element) &&
-                       IS_WALKABLE(old_element));
+  boolean new_element_is_player = ELEM_IS_PLAYER(new_element);
+  boolean add_player_onto_element = (new_element_is_player &&
+                                    new_element != EL_SOKOBAN_FIELD_PLAYER &&
+                                    IS_WALKABLE(old_element));
 
 #if 0
   /* check if element under the player changes from accessible to unaccessible
@@ -8465,7 +8467,7 @@ static void CreateFieldExt(int x, int y, int element, boolean is_change)
   }
 #endif
 
-  if (!add_player)
+  if (!add_player_onto_element)
   {
     if (IS_MOVING(x, y) || IS_BLOCKED(x, y))
       RemoveMovingField(x, y);
@@ -8516,7 +8518,7 @@ static void CreateFieldExt(int x, int y, int element, boolean is_change)
 #endif
 
   /* "ChangeCount" not set yet to allow "entered by player" change one time */
-  if (ELEM_IS_PLAYER(new_element))
+  if (new_element_is_player)
     RelocatePlayer(x, y, new_element);
 
   if (is_change)