X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=c614643e8d2bd8adf1e10c6bdd181f61d423f076;hb=c9bb6e0a6eecbf84320be79b121bd957a938a08c;hp=77cf39a00fdba9c92f5f0203782b86aaf47ba1ee;hpb=0d7a16964bdac425962c0c0bcaa7488d9664c8d2;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 77cf39a0..c614643e 100644 --- a/src/init.c +++ b/src/init.c @@ -481,19 +481,19 @@ void InitElementGraphicInfo() /* now set all '-1' values to element specific default values */ for (i=0; i= MAX_NUM_ELEMENTS) + if (element_class < 0 || element_class >= MAX_NUM_ELEMENTS) continue; if (action < 0) action = ACTION_DEFAULT; - element_info[element].sound[action] = sound; + for (j=0; j < MAX_NUM_ELEMENTS; j++) + if (strcmp(element_info[j].class_name, + element_info[element_class].class_name) == 0) + element_info[j].sound[action] = sound; } - /* initialize element class/sound mapping from dynamic configuration */ + /* initialize element/sound mapping from dynamic configuration */ for (i=0; i < num_property_mappings; i++) { - int element_class = property_mapping[i].base_index - MAX_NUM_ELEMENTS; - int action = property_mapping[i].ext1_index; - int sound = property_mapping[i].artwork_index; + int element = property_mapping[i].base_index; + int action = property_mapping[i].ext1_index; + int sound = property_mapping[i].artwork_index; - if (element_class < 0 || element_class >= MAX_NUM_ELEMENTS) + if (element >= MAX_NUM_ELEMENTS) continue; if (action < 0) action = ACTION_DEFAULT; - for (j=0; j < MAX_NUM_ELEMENTS; j++) - if (strcmp(element_info[j].class_name, - element_info[element_class].class_name) == 0) - element_info[j].sound[action] = sound; + element_info[element].sound[action] = sound; } /* now set all '-1' values to element specific default values */ for (i=0; i