rnd-20050603-1-src
authorHolger Schemel <info@artsoft.org>
Fri, 3 Jun 2005 07:29:34 +0000 (09:29 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:49:01 +0000 (10:49 +0200)
src/conftime.h
src/files.c
src/game.c
src/init.c
src/libgame/setup.c
src/main.h

index 0bbfda572d4b63e49c2bd5205f71a5ccf176bc12..5e4549ef2bdbabad54a4a4dc1714fba5ee653e9d 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2005-05-31 00:09]"
+#define COMPILE_DATE_STRING "[2005-06-03 01:24]"
index 473a73926cbcaa9f24502582db6844c9746b786a..6e1c770f0fcfb4afd19666a82c8e6ea7ad2afda9 100644 (file)
@@ -3959,7 +3959,7 @@ void SaveTape(int nr)
   InitTapeDirectory(leveldir_current->subdir);
 
   /* if a tape still exists, ask to overwrite it */
-  if (access(filename, F_OK) == 0)
+  if (fileExists(filename))
   {
     new_tape = FALSE;
     if (!Request("Replace old tape ?", REQ_ASK))
index af07f9bfc57962e777f779431f268c9ae6d13ae4..b6c1a51872114124e34b4d2d6a6779bf1a66cddb 100644 (file)
@@ -38,6 +38,9 @@
 #define USE_NEW_RANDOMIZE      (TRUE   * USE_NEW_STUFF         * 1)
 
 #define USE_PUSH_BUGFIX                (TRUE   * USE_NEW_STUFF         * 1)
+#define USE_BLOCK_DELAY_BUGFIX (TRUE   * USE_NEW_STUFF         * 1)
+#define USE_GRAVITY_BUGFIX     (TRUE   * USE_NEW_STUFF         * 0)
+#define USE_GRAVITY_BUGFIX_2   (TRUE   * USE_NEW_STUFF         * 1)
 
 #define USE_CAN_MOVE_NOT_MOVING        (TRUE   * USE_NEW_STUFF         * 1)
 #define USE_PREVIOUS_MOVE_DIR  (TRUE   * USE_NEW_STUFF         * 1)
@@ -9485,7 +9488,9 @@ static boolean canFallDown(struct PlayerInfo *player)
   return (IN_LEV_FIELD(jx, jy + 1) &&
          (IS_FREE(jx, jy + 1) ||
 #if USE_NEW_BLOCK_STYLE
+#if USE_GRAVITY_BUGFIX
           Feld[jx][jy + 1] == EL_PLAYER_IS_LEAVING ||
+#endif
 #endif
           (Feld[jx][jy + 1] == EL_ACID && player->can_fall_into_acid)) &&
          IS_WALKABLE_FROM(Feld[jx][jy], MV_DOWN) &&
@@ -10154,8 +10159,24 @@ void ScrollPlayer(struct PlayerInfo *player, int mode)
     if (player->block_delay > 0 &&
        Feld[last_jx][last_jy] == EL_EMPTY)
     {
+      int last_field_block_delay = player->block_delay;
+
+#if USE_BLOCK_DELAY_BUGFIX
+      /* when blocking enabled, correct block delay for fast movement */
+      if (player->block_delay > 1 &&
+         player->move_delay_value < MOVE_DELAY_NORMAL_SPEED)
+       last_field_block_delay = player->move_delay_value;
+#endif
+
+#if USE_GRAVITY_BUGFIX_2
+      /* when blocking enabled, correct block delay for gravity movement */
+      if (player->block_delay > 1 &&
+         game.gravity && player->MovDir == MV_UP)
+       last_field_block_delay = player->move_delay_value - 1;
+#endif
+
       Feld[last_jx][last_jy] = EL_PLAYER_IS_LEAVING;
-      MovDelay[last_jx][last_jy] = player->block_delay + 1;
+      MovDelay[last_jx][last_jy] = last_field_block_delay + 1;
     }
 #else
 #if USE_NEW_MOVE_STYLE
index bce313726214736f80f76eca3b800d19ce164e75..6e970c2f217963eb67cb7319c7e1feeea3cbd785 100644 (file)
@@ -2529,7 +2529,9 @@ void InitElementPropertiesStatic()
     EL_PENGUIN,
     EL_PIG,
     EL_DRAGON,
+#if 0  /* USE_GRAVITY_BUGFIX */
     EL_PLAYER_IS_LEAVING,      /* needed for gravity + "block last field" */
+#endif
     -1
   };
 
@@ -4172,7 +4174,7 @@ void Execute_Command(char *command)
   {
     char *filename = &command[11];
 
-    if (access(filename, F_OK) != 0)
+    if (!fileExists(filename))
       Error(ERR_EXIT, "cannot open file '%s'", filename);
 
     LoadLevelFromFilename(&level, filename);
@@ -4184,7 +4186,7 @@ void Execute_Command(char *command)
   {
     char *filename = &command[10];
 
-    if (access(filename, F_OK) != 0)
+    if (!fileExists(filename))
       Error(ERR_EXIT, "cannot open file '%s'", filename);
 
     LoadTapeFromFilename(filename);
index 130182df10e95511745e4df67a7e2b1b690b1cea..967fbcfacd60a10e9f36eacfdcd74b3fbd11a3a7 100644 (file)
@@ -780,7 +780,7 @@ static void SaveUserLevelInfo();
 
 void InitUserLevelDirectory(char *level_subdir)
 {
-  if (access(getUserLevelDir(level_subdir), F_OK) != 0)
+  if (!fileExists(getUserLevelDir(level_subdir)))
   {
     createDirectory(getUserDataDir(), "user data", PERMS_PRIVATE);
     createDirectory(getUserLevelDir(NULL), "main user level", PERMS_PRIVATE);
@@ -1114,7 +1114,7 @@ void createDirectory(char *dir, char *text, int permission_class)
   mode_t group_umask = ~(dir_mode & S_IRWXG);
   posix_umask(normal_umask & group_umask);
 
-  if (access(dir, F_OK) != 0)
+  if (!fileExists(dir))
     if (posix_mkdir(dir, dir_mode) != 0)
       Error(ERR_WARN, "cannot create %s directory '%s'", text, dir);
 
@@ -1417,17 +1417,18 @@ static void *loadSetupFileData(char *filename, boolean use_hash)
   boolean read_continued_line = FALSE;
   FILE *file;
 
-  if (use_hash)
-    setup_file_data = newSetupFileHash();
-  else
-    insert_ptr = setup_file_data = newSetupFileList("", "");
-
   if (!(file = fopen(filename, MODE_READ)))
   {
     Error(ERR_WARN, "cannot open configuration file '%s'", filename);
+
     return NULL;
   }
 
+  if (use_hash)
+    setup_file_data = newSetupFileHash();
+  else
+    insert_ptr = setup_file_data = newSetupFileList("", "");
+
   while (!feof(file))
   {
     /* read next line of input file */
@@ -1953,10 +1954,21 @@ static boolean LoadLevelInfoFromLevelConf(TreeInfo **node_first,
 {
   char *directory_path = getPath2(level_directory, directory_name);
   char *filename = getPath2(directory_path, LEVELINFO_FILENAME);
-  SetupFileHash *setup_file_hash = loadSetupFileHash(filename);
+  SetupFileHash *setup_file_hash;
   LevelDirTree *leveldir_new = NULL;
   int i;
 
+  /* unless debugging, silently ignore directories without "levelinfo.conf" */
+  if (!options.debug && !fileExists(filename))
+  {
+    free(directory_path);
+    free(filename);
+
+    return FALSE;
+  }
+
+  setup_file_hash = loadSetupFileHash(filename);
+
   if (setup_file_hash == NULL)
   {
     Error(ERR_WARN, "ignoring level directory '%s'", directory_path);
@@ -2166,7 +2178,7 @@ static boolean LoadArtworkInfoFromArtworkConf(TreeInfo **node_first,
   TreeInfo *artwork_new = NULL;
   int i;
 
-  if (access(filename, F_OK) == 0)             /* file exists */
+  if (fileExists(filename))
     setup_file_hash = loadSetupFileHash(filename);
 
   if (setup_file_hash == NULL) /* no config file -- look for artwork files */
index c8c83033f75c4cb23418dd10f91b3112e045fa9a..1297f845e783266a02c9251c2a4d9298777ec1b5 100644 (file)
 #define PROGRAM_VERSION_MAJOR          3
 #define PROGRAM_VERSION_MINOR          2
 #define PROGRAM_VERSION_PATCH          0
-#define PROGRAM_VERSION_BUILD          2
+#define PROGRAM_VERSION_BUILD          3
 
 #define PROGRAM_TITLE_STRING           "Rocks'n'Diamonds"
 #define PROGRAM_AUTHOR_STRING          "Holger Schemel"