X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Finit.c;h=d9f258eeeed65acc476d5b009effc12b1cf2ea02;hp=ee8df89223c4cf391781c92fc67f19e46470bc0c;hb=013255ff68bf77db29470e26ac4cd7777836c8b0;hpb=78f3f677c919e5c185c63f462b54b72d73ca9c57 diff --git a/src/init.c b/src/init.c index ee8df892..d9f258ee 100644 --- a/src/init.c +++ b/src/init.c @@ -4408,7 +4408,7 @@ static void InitGlobal() element_info[i].token_name = element_name_info[i].token_name; element_info[i].class_name = element_name_info[i].class_name; - element_info[i].editor_description=element_name_info[i].editor_description; + element_info[i].editor_description= element_name_info[i].editor_description; #if 0 printf("%04d: %s\n", i, element_name_info[i].token_name); @@ -4428,6 +4428,19 @@ static void InitGlobal() ActiveElement[element] = element_active; } + /* always start with reliable default values (all buttons) */ + for (i = 0; i < NUM_IMAGE_FILES; i++) + ActiveButton[i] = i; + + /* now add all entries that have an active state (active buttons) */ + for (i = 0; button_with_active_state[i].button != -1; i++) + { + int button = button_with_active_state[i].button; + int button_active = button_with_active_state[i].button_active; + + ActiveButton[button] = button_active; + } + /* always start with reliable default values (all fonts) */ for (i = 0; i < NUM_FONTS; i++) ActiveFont[i] = i;