X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ffiles.c;h=1321fe9cc7be00bc3511c13887a56af1a331aef4;hb=f857fec3082c785b0dd271b6ad1b7642a2ed4e65;hp=36380f92eef55a65368f4c6447240adb6680d06d;hpb=6a066eac92bfa607cec653f6a97917891aee0d95;p=rocksndiamonds.git diff --git a/src/files.c b/src/files.c index 36380f92..1321fe9c 100644 --- a/src/files.c +++ b/src/files.c @@ -17,6 +17,7 @@ #include "libgame/libgame.h" #include "files.h" +#include "init.h" #include "tools.h" #include "tape.h" @@ -44,7 +45,7 @@ static void setLevelInfoToDefaults() { - int i, x, y; + int i, j, x, y; level.file_version = FILE_VERSION_ACTUAL; level.game_version = GAME_VERSION_ACTUAL; @@ -97,7 +98,14 @@ static void setLevelInfoToDefaults() for (i=0; i < NUM_CUSTOM_ELEMENTS; i++) { level.custom_element_successor[i] = EL_EMPTY_SPACE; + + /* start with no properties at all */ +#if 1 + for (j=0; j < NUM_EP_BITFIELDS; j++) + Properties[EL_CUSTOM_START + i][j] = EP_BITMASK_DEFAULT; +#else Properties[EL_CUSTOM_START + i][EP_BITFIELD_BASE] = EP_BITMASK_DEFAULT; +#endif } BorderElement = EL_STEELWALL; @@ -581,6 +589,7 @@ void LoadLevel(int level_nr) char *filename = getLevelFilename(level_nr); LoadLevelFromFilename(filename); + InitElementPropertiesEngine(level.game_version); } static void SaveLevel_VERS(FILE *file, struct LevelInfo *level) @@ -1698,32 +1707,32 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->options.verbose = FALSE; } -static void decodeSetupFileList(struct SetupFileList *setup_file_list) +static void decodeSetupFileHash(SetupFileHash *setup_file_hash) { int i, pnr; - if (!setup_file_list) + if (!setup_file_hash) return; /* global setup */ si = setup; for (i=0; i