From: Holger Schemel Date: Wed, 1 Mar 2017 08:26:13 +0000 (+0100) Subject: changed initializing CE properties to older versions (code cleanup) X-Git-Tag: 4.1.0.0~184 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=52e017626088f7b931acbb301f2234faa782de88;p=rocksndiamonds.git changed initializing CE properties to older versions (code cleanup) --- diff --git a/src/files.c b/src/files.c index a8038197..c60e08b4 100644 --- a/src/files.c +++ b/src/files.c @@ -6452,6 +6452,20 @@ static void LoadLevel_InitCustomElements(struct LevelInfo *level) } } } + + /* set some other uninitialized values of custom elements in older levels */ + if (level->game_version < VERSION_IDENT(3,1,0,0)) + { + for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) + { + int element = EL_CUSTOM_START + i; + + element_info[element].access_direction = MV_ALL_DIRECTIONS; + + element_info[element].explosion_delay = 17; + element_info[element].ignition_delay = 8; + } + } } static void LoadLevel_InitElements(struct LevelInfo *level, char *filename) @@ -6461,9 +6475,6 @@ static void LoadLevel_InitElements(struct LevelInfo *level, char *filename) if (level->file_has_custom_elements) LoadLevel_InitCustomElements(level); - if (level->file_has_custom_elements) - InitElementPropertiesAfterLoading(level->game_version); - /* initialize element properties for level editor etc. */ InitElementPropertiesEngine(level->game_version); InitElementPropertiesGfxElement(); diff --git a/src/init.c b/src/init.c index c6b6d0d3..4bde60f9 100644 --- a/src/init.c +++ b/src/init.c @@ -4683,25 +4683,6 @@ void InitElementPropertiesEngine(int engine_version) InitElementGraphicInfo(); } -void InitElementPropertiesAfterLoading(int engine_version) -{ - int i; - - /* set some other uninitialized values of custom elements in older levels */ - if (engine_version < VERSION_IDENT(3,1,0,0)) - { - for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) - { - int element = EL_CUSTOM_START + i; - - element_info[element].access_direction = MV_ALL_DIRECTIONS; - - element_info[element].explosion_delay = 17; - element_info[element].ignition_delay = 8; - } - } -} - void InitElementPropertiesGfxElement() { int i; diff --git a/src/init.h b/src/init.h index ab14b75d..bd4ba9c1 100644 --- a/src/init.h +++ b/src/init.h @@ -33,7 +33,6 @@ boolean getBitfieldProperty(int *, int, int); void ResolveGroupElement(int); void InitElementPropertiesStatic(void); void InitElementPropertiesEngine(int); -void InitElementPropertiesAfterLoading(int); void InitElementPropertiesGfxElement(); void ReloadCustomArtwork(int);