X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=9871ed6cd8c3f0c5c0c4dc1ed5ad04a3edeb5837;hb=b33f1968ccf98a334e4fbab169ecf4e7bc90401f;hp=6b535794c9a0c7c35acb73e9e0d5c7a4b586b59d;hpb=74c0f7de91268e40d15948f473eac51a9760b9c0;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 6b535794..9871ed6c 100644 --- a/src/init.c +++ b/src/init.c @@ -614,9 +614,9 @@ void InitElementGraphicInfo() for (act = 0; act < NUM_ACTIONS; act++) { - boolean act_remove = ((IS_DIGGABLE(i) && act == ACTION_DIGGING) || - (IS_SNAPPABLE(i) && act == ACTION_SNAPPING) || - (IS_COLLECTIBLE(i) && act == ACTION_COLLECTING)); + boolean act_remove = (act == ACTION_DIGGING || + act == ACTION_SNAPPING || + act == ACTION_COLLECTING); boolean act_turning = (act == ACTION_TURNING_FROM_LEFT || act == ACTION_TURNING_FROM_RIGHT || act == ACTION_TURNING_FROM_UP || @@ -967,8 +967,7 @@ static void InitGraphicInfo() GC copy_clipmask_gc = None; #endif - if (graphic_info != NULL) - free(graphic_info); + checked_free(graphic_info); graphic_info = checked_calloc(num_images * sizeof(struct GraphicInfo)); @@ -1192,9 +1191,12 @@ static void InitElementSoundInfo() if (IS_SB_ELEMENT(i) && element_info[EL_SB_DEFAULT].sound[act] != -1) default_action_sound = element_info[EL_SB_DEFAULT].sound[act]; + /* !!! there's no such thing as a "default action sound" !!! */ +#if 0 /* look for element specific default sound (independent from action) */ if (element_info[i].sound[ACTION_DEFAULT] != -1) default_action_sound = element_info[i].sound[ACTION_DEFAULT]; +#endif /* no sound for this specific action -- use default action sound */ if (element_info[i].sound[act] == -1) @@ -1262,8 +1264,7 @@ static void InitSoundInfo() int num_sounds = getSoundListSize(); int i, j; - if (sound_info != NULL) - free(sound_info); + checked_free(sound_info); sound_effect_properties = checked_calloc(num_sounds * sizeof(int)); sound_info = checked_calloc(num_sounds * sizeof(struct SoundInfo)); @@ -1494,8 +1495,7 @@ static void InitMusicInfo() int num_music = getMusicListSize(); int i, j; - if (music_info != NULL) - free(music_info); + checked_free(music_info); music_info = checked_calloc(num_music * sizeof(struct MusicInfo)); @@ -1831,6 +1831,7 @@ void InitElementPropertiesStatic() EL_SP_ELECTRON, EL_BALLOON, EL_SPRING, + EL_MAZE_RUNNER, -1 };