rnd-20040119-B-src
authorHolger Schemel <info@artsoft.org>
Mon, 19 Jan 2004 19:10:04 +0000 (20:10 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:45:31 +0000 (10:45 +0200)
* fixed bug which allowed creating emeralds by escaping explosions

ChangeLog
Makefile
src/Makefile
src/conftime.h
src/game.c
src/main.c
src/main.h

index 52c346e5432bc63db05cb1cc21778f5c592cf220..aa185bf5e07d1966295f2a3cbe5ce8b3e63cea0e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+
+2004-01-19
+       * fixed bug which allowed creating emeralds by escaping explosions
+
 2004-01-18
        * custom elements can change (limited) or leave (unlimited) elements
        * finally added multiple matches using group elements
index e97587dbc3f9ecddf1c6850dda2a833c463ae470..63962f78924e68df5efd4b390463345ae240b459 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -50,8 +50,8 @@ CROSS_PATH_WIN32=/usr/local/cross-tools/i386-mingw32msvc
 SRC_DIR = src
 MAKE_CMD = $(MAKE) -C $(SRC_DIR)
 
-DEFAULT_TARGET = x11
-DEFAULT_TARGET = sdl
+DEFAULT_TARGET = x11
+DEFAULT_TARGET = sdl
 
 
 # -----------------------------------------------------------------------------
index 976f86bc60b6322e923e014760a404ff605caf0c..a0d7cfa2cce5c5e06e0866b334cd3f523bd38773 100644 (file)
@@ -76,7 +76,8 @@ endif
 
 ifeq ($(TARGET),x11)
 SYS_CFLAGS  = -DTARGET_X11 $(X11_INCL)
-SYS_LDFLAGS = $(X11_LIBS) -lX11
+# SYS_LDFLAGS = $(X11_LIBS) -lX11
+SYS_LDFLAGS = $(XLIB_PATH)/libX11.a
 endif
 
 ifeq ($(TARGET),sdl)
index a28ef038f499aa696a984e23abad9647a126950c..333e8073816ec2f51d507055af260ffa7c12bb55 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2004-01-18 18:14]"
+#define COMPILE_DATE_STRING "[2004-01-19 19:09]"
index 1e059f86912af4a5005697db90861defad8b83bd..bab2a31211f966ac2cfa56d2328e64da733fd4f6 100644 (file)
@@ -2499,17 +2499,17 @@ void Explode(int ex, int ey, int phase, int mode)
        switch(StorePlayer[ex][ey])
        {
          case EL_PLAYER_2:
-           Store[x][y] = EL_EMERALD_RED;
+           Store[x][y] = EL_PLAYER_IS_EXPLODING_2;
            break;
          case EL_PLAYER_3:
-           Store[x][y] = EL_EMERALD;
+           Store[x][y] = EL_PLAYER_IS_EXPLODING_3;
            break;
          case EL_PLAYER_4:
-           Store[x][y] = EL_EMERALD_PURPLE;
+           Store[x][y] = EL_PLAYER_IS_EXPLODING_4;
            break;
          case EL_PLAYER_1:
          default:
-           Store[x][y] = EL_EMERALD_YELLOW;
+           Store[x][y] = EL_PLAYER_IS_EXPLODING_1;
            break;
        }
 
@@ -2656,6 +2656,17 @@ void Explode(int ex, int ey, int phase, int mode)
     Store[x][y] = Store2[x][y] = 0;
     GfxElement[x][y] = EL_UNDEFINED;
 
+    /* player can escape from explosions and might therefore be still alive */
+    if (element >= EL_PLAYER_IS_EXPLODING_1 &&
+       element <= EL_PLAYER_IS_EXPLODING_4)
+      Feld[x][y] = (stored_player[element - EL_PLAYER_IS_EXPLODING_1].active ?
+                   EL_EMPTY :
+                   element == EL_PLAYER_IS_EXPLODING_1 ? EL_EMERALD_YELLOW :
+                   element == EL_PLAYER_IS_EXPLODING_2 ? EL_EMERALD_RED :
+                   element == EL_PLAYER_IS_EXPLODING_3 ? EL_EMERALD :
+                   EL_EMERALD_PURPLE);
+
+    /* restore probably existing indestructible background element */
     if (Back[x][y] && IS_INDESTRUCTIBLE(Back[x][y]))
       element = Feld[x][y] = Back[x][y];
     Back[x][y] = 0;
@@ -2666,8 +2677,11 @@ void Explode(int ex, int ey, int phase, int mode)
     ChangePage[x][y] = -1;
 
     InitField(x, y, FALSE);
+#if 1
+    /* !!! not needed !!! */
     if (CAN_MOVE(element))
       InitMovDir(x, y);
+#endif
     DrawLevelField(x, y);
 
     TestIfElementTouchesCustomElement(x, y);
index 990a7b7155309394d72ca70cb3f2edfff51109e1..6ab095ebc871c75e6c597062ed02e5f875b81ccd 100644 (file)
@@ -3684,6 +3684,26 @@ struct ElementInfo element_info[MAX_NUM_ELEMENTS + 1] =
     "-",
     "-"
   },
+  {
+    "player_is_exploding_1",
+    "-",
+    "-"
+  },
+  {
+    "player_is_exploding_2",
+    "-",
+    "-"
+  },
+  {
+    "player_is_exploding_3",
+    "-",
+    "-"
+  },
+  {
+    "player_is_exploding_4",
+    "-",
+    "-"
+  },
   {
     "quicksand.filling",
     "quicksand",
index f449795aac7722dd4d1ed5999ff376df10a72d55..345e9f9dfc0600ab468b086c2f8f046bdd903a26 100644 (file)
 #define EL_EXPANDABLE_WALL_GROWING     (EL_FIRST_RUNTIME_UNREAL + 8)
 #define EL_FLAMES                      (EL_FIRST_RUNTIME_UNREAL + 9)
 #define EL_PLAYER_IS_LEAVING           (EL_FIRST_RUNTIME_UNREAL + 10)
-#define EL_QUICKSAND_FILLING           (EL_FIRST_RUNTIME_UNREAL + 11)
-#define EL_MAGIC_WALL_FILLING          (EL_FIRST_RUNTIME_UNREAL + 12)
-#define EL_BD_MAGIC_WALL_FILLING       (EL_FIRST_RUNTIME_UNREAL + 13)
+#define EL_PLAYER_IS_EXPLODING_1       (EL_FIRST_RUNTIME_UNREAL + 11)
+#define EL_PLAYER_IS_EXPLODING_2       (EL_FIRST_RUNTIME_UNREAL + 12)
+#define EL_PLAYER_IS_EXPLODING_3       (EL_FIRST_RUNTIME_UNREAL + 13)
+#define EL_PLAYER_IS_EXPLODING_4       (EL_FIRST_RUNTIME_UNREAL + 14)
+#define EL_QUICKSAND_FILLING           (EL_FIRST_RUNTIME_UNREAL + 15)
+#define EL_MAGIC_WALL_FILLING          (EL_FIRST_RUNTIME_UNREAL + 16)
+#define EL_BD_MAGIC_WALL_FILLING       (EL_FIRST_RUNTIME_UNREAL + 17)
 
 /* dummy elements (never used as game elements, only used as graphics) */
-#define EL_FIRST_DUMMY                 (EL_FIRST_RUNTIME_UNREAL + 14)
+#define EL_FIRST_DUMMY                 (EL_FIRST_RUNTIME_UNREAL + 18)
 
 #define EL_STEELWALL_TOPLEFT                   (EL_FIRST_DUMMY + 0)
 #define EL_STEELWALL_TOPRIGHT                  (EL_FIRST_DUMMY + 1)