rnd-20061028-3-src
authorHolger Schemel <info@artsoft.org>
Sat, 28 Oct 2006 21:44:36 +0000 (23:44 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:53:34 +0000 (10:53 +0200)
<  * fixed bug which caused elements with "change when digging <e>" event

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

index ee351ca062a80bcd778725c3e125b08b4e09725a..8184cc3eeebba04394daea2cc35fcf650945adf9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,11 @@
 2006-10-28
        * fixed bug when displaying titlescreen with size less than element tile
-       * fixed bug which caused elements with "change when digging <e>" event
+       * fixed bug that caused elements with "change when digging <e>" event
          to change for _every_ digged element, not only those specified in <e>
+       * fixed bug that caused impact style collision when dropping element one
+         tile over the player that can both fall down and smash players
+       * fixed bug that caused impact style collision when element changed to
+         falling/smashing element over the player immediately after movement
 
 2006-10-24
        * fixed bug that allowed making engine snapshots from the level editor
index 8deef746ead6f3290be17ff603046c49fc85ba7c..4490d2ae7ebd77a67214fd91c1eff00b7266b5c5 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-10-28 14:24]"
+#define COMPILE_DATE_STRING "[2006-10-28 22:48]"
index 5cf59431589d00d9bb1ca84e0224f17f44dafb0e..f0875a7a1d49fefefeb72cd8cad48bfe3a2b4366 100644 (file)
@@ -57,6 +57,7 @@
 #define USE_GFX_RESET_PLAYER_ARTWORK   (USE_NEW_STUFF          * 1)
 
 #define USE_FIX_KILLED_BY_NON_WALKABLE (USE_NEW_STUFF          * 1)
+#define USE_FIX_IMPACT_COLLISION       (USE_NEW_STUFF          * 1)
 
 
 /* for DigField() */
 
 /* values for delayed check of falling and moving elements and for collision */
 #define CHECK_DELAY_MOVING     3
-#define CHECK_DELAY_FALLING    3
+#define CHECK_DELAY_FALLING    CHECK_DELAY_MOVING
 #define CHECK_DELAY_COLLISION  2
+#define CHECK_DELAY_IMPACT     CHECK_DELAY_COLLISION
 
 /* values for initial player move delay (initial delay counter value) */
 #define INITIAL_MOVE_DELAY_OFF -1
@@ -2037,6 +2039,7 @@ void InitGame()
     WasJustMoving[x][y] = 0;
     WasJustFalling[x][y] = 0;
     CheckCollision[x][y] = 0;
+    CheckImpact[x][y] = 0;
     Stop[x][y] = FALSE;
     Pushed[x][y] = FALSE;
 
@@ -5634,9 +5637,14 @@ void StartMoving(int x, int y)
 
       Store[x][y] = EL_ACID;
     }
-    else if ((game.engine_version >= VERSION_IDENT(3,1,0,0) &&
+    else if (
+#if USE_FIX_IMPACT_COLLISION
+            (game.engine_version >= VERSION_IDENT(3,1,0,0) &&
+             CheckImpact[x][y] && !IS_FREE(x, y + 1)) ||
+#else
+            (game.engine_version >= VERSION_IDENT(3,1,0,0) &&
              CheckCollision[x][y] && !IS_FREE(x, y + 1)) ||
-
+#endif
             (game.engine_version >= VERSION_IDENT(3,0,7,0) &&
              CAN_FALL(element) && WasJustFalling[x][y] &&
              (Feld[x][y + 1] == EL_BLOCKED || IS_PLAYER(x, y + 1))) ||
@@ -5656,6 +5664,7 @@ void StartMoving(int x, int y)
         simply not covered here... :-/ ) */
 
       CheckCollision[x][y] = 0;
+      CheckImpact[x][y] = 0;
 
       Impact(x, y);
     }
@@ -6600,6 +6609,11 @@ void ContinueMoving(int x, int y)
 
     if ((!CAN_FALL(element) || direction == MV_DOWN) && check_collision_again)
       CheckCollision[newx][newy] = CHECK_DELAY_COLLISION;
+
+#if USE_FIX_IMPACT_COLLISION
+    if (CAN_FALL(element) && direction == MV_DOWN && check_collision_again)
+      CheckImpact[newx][newy] = CHECK_DELAY_IMPACT;
+#endif
   }
 
   if (DONT_TOUCH(element))     /* object may be nasty to player or others */
@@ -9429,6 +9443,8 @@ void GameActions_RND()
       WasJustFalling[x][y]--;
     if (CheckCollision[x][y] > 0)
       CheckCollision[x][y]--;
+    if (CheckImpact[x][y] > 0)
+      CheckImpact[x][y]--;
 
     GfxFrame[x][y]++;
 
@@ -12065,7 +12081,13 @@ boolean DropElement(struct PlayerInfo *player)
     nexty = dropy + GET_DY_FROM_DIR(move_direction);
 
     ChangeCount[dropx][dropy] = 0;     /* allow at least one more change */
+
+#if USE_FIX_IMPACT_COLLISION
+    /* do not cause impact style collision by dropping elements that can fall */
+    CheckCollision[dropx][dropy] = CHECK_DELAY_COLLISION;
+#else
     CheckCollision[dropx][dropy] = CHECK_DELAY_COLLISION;
+#endif
   }
 
   player->drop_delay = GET_NEW_DROP_DELAY(drop_element);
@@ -12747,6 +12769,7 @@ void SaveEngineSnapshot()
   SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(WasJustMoving));
   SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(WasJustFalling));
   SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(CheckCollision));
+  SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(CheckImpact));
   SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(Stop));
   SaveEngineSnapshotBuffer(ARGS_ADDRESS_AND_SIZEOF(Pushed));
 
index 0ef4dc379c009b2a7d13122b488306f1faf12399..ee3a1552501dc795292f30884c4af9d54fd45189 100644 (file)
@@ -974,10 +974,18 @@ static void set_graphic_parameters(int graphic)
   graphic_info[graphic].post_delay = -1;
   graphic_info[graphic].auto_delay = -1;
 
+#if 1
+  /* optional zoom factor for scaling up the image to a larger size */
+  if (parameter[GFX_ARG_SCALE_UP_FACTOR] != ARG_UNDEFINED_VALUE)
+    graphic_info[graphic].scale_up_factor = parameter[GFX_ARG_SCALE_UP_FACTOR];
+  if (graphic_info[graphic].scale_up_factor < 1)
+    graphic_info[graphic].scale_up_factor = 1;         /* no scaling */
+#endif
+
 #if 1
   if (graphic_info[graphic].use_image_size)
   {
-    /* set default bitmap size (with scaling, but without small images) */
+    /* set new default bitmap size (with scaling, but without small images) */
     graphic_info[graphic].width  = get_scaled_graphic_width(graphic);
     graphic_info[graphic].height = get_scaled_graphic_height(graphic);
   }
@@ -1001,11 +1009,13 @@ static void set_graphic_parameters(int graphic)
   if (parameter[GFX_ARG_HEIGHT] != ARG_UNDEFINED_VALUE)
     graphic_info[graphic].height = parameter[GFX_ARG_HEIGHT];
 
+#if 0
   /* optional zoom factor for scaling up the image to a larger size */
   if (parameter[GFX_ARG_SCALE_UP_FACTOR] != ARG_UNDEFINED_VALUE)
     graphic_info[graphic].scale_up_factor = parameter[GFX_ARG_SCALE_UP_FACTOR];
   if (graphic_info[graphic].scale_up_factor < 1)
     graphic_info[graphic].scale_up_factor = 1;         /* no scaling */
+#endif
 
   if (src_bitmap)
   {
index 32d7fa7db33ddcecabf29db434c1d5a541698b28..148abb546b7c802d5897b916fd479d41d49b6d1c 100644 (file)
@@ -59,6 +59,7 @@ short                 ChangeEvent[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  WasJustMoving[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  WasJustFalling[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  CheckCollision[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  CheckImpact[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  AmoebaCnt[MAX_NUM_AMOEBA];
 short                  AmoebaCnt2[MAX_NUM_AMOEBA];
index 70ea792a9844e53ad0bd9507eb9883f57b4b8ec8..5e5196786e3e90534d9a13e7c3b35d823f9a4ce7 100644 (file)
@@ -2479,6 +2479,7 @@ extern short                      ChangeEvent[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern short                   WasJustMoving[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern short                   WasJustFalling[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern short                   CheckCollision[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short                   CheckImpact[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern short                   AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern short                   AmoebaCnt[MAX_NUM_AMOEBA];
 extern short                   AmoebaCnt2[MAX_NUM_AMOEBA];