-#define COMPILE_DATE_STRING "[2005-05-31 00:09]"
+#define COMPILE_DATE_STRING "[2005-06-03 01:24]"
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))
#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)
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) &&
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
EL_PENGUIN,
EL_PIG,
EL_DRAGON,
+#if 0 /* USE_GRAVITY_BUGFIX */
EL_PLAYER_IS_LEAVING, /* needed for gravity + "block last field" */
+#endif
-1
};
{
char *filename = &command[11];
- if (access(filename, F_OK) != 0)
+ if (!fileExists(filename))
Error(ERR_EXIT, "cannot open file '%s'", filename);
LoadLevelFromFilename(&level, filename);
{
char *filename = &command[10];
- if (access(filename, F_OK) != 0)
+ if (!fileExists(filename))
Error(ERR_EXIT, "cannot open file '%s'", filename);
LoadTapeFromFilename(filename);
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);
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);
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 */
{
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);
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 */
#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"