changed "http" to "https" in URLs
[rocksndiamonds.git] / src / game.c
index e22a7367d4e296ffc6a0975c2723db1eed6dbdcc..803eebb327f93d0ca0f6cc636a4f388025ceafbb 100644 (file)
@@ -4,7 +4,7 @@
 // (c) 1995-2014 by Artsoft Entertainment
 //                         Holger Schemel
 //                 info@artsoft.org
-//                 http://www.artsoft.org/
+//                 https://www.artsoft.org/
 // ----------------------------------------------------------------------------
 // game.c
 // ============================================================================
@@ -1785,7 +1785,7 @@ static void InitPlayerField(int x, int y, int element, boolean init_game)
     player->jy = player->last_jy = y;
   }
 
-  if (!init_game)
+  // always check if player was just killed and should be reanimated
   {
     int player_nr = GET_PLAYER_NR(element);
     struct PlayerInfo *player = &stored_player[player_nr];
@@ -1877,6 +1877,8 @@ static void InitField(int x, int y, boolean init_game)
     case EL_MOLE_RIGHT:
     case EL_MOLE_UP:
     case EL_MOLE_DOWN:
+    case EL_SPRING_LEFT:
+    case EL_SPRING_RIGHT:
       InitMovDir(x, y);
       break;
 
@@ -2840,6 +2842,19 @@ static void InitGameEngine(void)
     game.team_mode = (num_players > 1);
   }
 
+#if 0
+  printf("level %d: level.game_version  == %06d\n", level_nr,
+        level.game_version);
+  printf("          tape.file_version   == %06d\n",
+        tape.file_version);
+  printf("          tape.game_version   == %06d\n",
+        tape.game_version);
+  printf("          tape.engine_version == %06d\n",
+        tape.engine_version);
+  printf("       => game.engine_version == %06d [tape mode: %s]\n",
+        game.engine_version, (tape.playing ? "PLAYING" : "RECORDING"));
+#endif
+
   // --------------------------------------------------------------------------
   // set flags for bugs and changes according to active game engine version
   // --------------------------------------------------------------------------
@@ -2978,6 +2993,18 @@ static void InitGameEngine(void)
   game_em.use_old_explosions =
     (game.engine_version < VERSION_IDENT(4,1,4,2));
 
+  game_em.use_old_android =
+    (game.engine_version < VERSION_IDENT(4,1,4,2));
+
+  game_em.use_old_push_elements =
+    (game.engine_version < VERSION_IDENT(4,1,4,2));
+
+  game_em.use_old_push_into_acid =
+    (game.engine_version < VERSION_IDENT(4,1,4,2));
+
+  game_em.use_wrap_around =
+    (game.engine_version > VERSION_IDENT(4,1,4,1));
+
   // --------------------------------------------------------------------------
 
   // set maximal allowed number of custom element changes per game frame
@@ -2995,14 +3022,6 @@ static void InitGameEngine(void)
   if (use_amoeba_dropping_cannot_fall_bug)
     SET_PROPERTY(EL_AMOEBA_DROPPING, EP_CAN_FALL, FALSE);
 
-#if 0
-  printf("level %d: level version == %06d\n", level_nr, level.game_version);
-  printf("          tape version == %06d [%s] [file: %06d]\n",
-        tape.engine_version, (tape.playing ? "PLAYING" : "RECORDING"),
-        tape.file_version);
-  printf("       => game.engine_version == %06d\n", game.engine_version);
-#endif
-
   // ---------- initialize player's initial move delay ------------------------
 
   // dynamically adjust player properties according to level information
@@ -4389,12 +4408,6 @@ void UpdateEngineValues(int actual_scroll_x, int actual_scroll_y,
 {
   // this is used for non-R'n'D game engines to update certain engine values
 
-  if (level.game_engine_type == GAME_ENGINE_TYPE_EM)
-  {
-    actual_player_x = correctLevelPosX_EM(actual_player_x);
-    actual_player_y = correctLevelPosY_EM(actual_player_y);
-  }
-
   // needed to determine if sounds are played within the visible screen area
   scroll_x = actual_scroll_x;
   scroll_y = actual_scroll_y;
@@ -4487,6 +4500,12 @@ void InitMovDir(int x, int y)
       MovDir[x][y] = direction[2][element - EL_MOLE_LEFT];
       break;
 
+    case EL_SPRING_LEFT:
+    case EL_SPRING_RIGHT:
+      Feld[x][y] = EL_SPRING;
+      MovDir[x][y] = direction[2][element - EL_SPRING_LEFT];
+      break;
+
     default:
       if (IS_CUSTOM_ELEMENT(element))
       {
@@ -14853,9 +14872,9 @@ static void PlayLevelMusic(void)
 void PlayLevelSound_EM(int xx, int yy, int element_em, int sample)
 {
   int element = (element_em > -1 ? map_element_EM_to_RND_game(element_em) : 0);
-  int offset = (BorderElement == EL_STEELWALL ? 1 : 0);
-  int x = xx - 1 - offset;
-  int y = yy - 1 - offset;
+  int offset = 0;
+  int x = xx - offset;
+  int y = yy - offset;
 
   switch (sample)
   {