diff --git a/src/loader.c b/src/loader.c index 6154167..9fddf64 100644 --- a/src/loader.c +++ b/src/loader.c @@ -44,7 +44,17 @@ int load_elements(hashmap *m, char *table, int use_inv) { char *combo = calloc(strlen(combo_o) + 1, sizeof(char)); strcpy(combo, combo_o); - if (use_inv == 2) { + if (use_inv == 3) { + uintptr_t result; + hashmap_get(m, str, strlen(str) - 1, &result); + + char *res = (char *)result; + + if (res != 0 && strcmp(res, combo) == 0) + continue; + } + + if (use_inv == 2 || use_inv == 3) { hashmap_set(m, str, strlen(str) - 1, (uintptr_t)combo, 1); continue; } diff --git a/src/main.c b/src/main.c index 440670c..584ac29 100644 --- a/src/main.c +++ b/src/main.c @@ -16,9 +16,9 @@ void init_tables(hashmap *elements, hashmap *inv, hashmap *polls, load_elements(elements, combo_file, 0) || load_elements(elements, "bin/" combo_file, 0); - load_elements(elements_rev, "../elem_data/" combo_file, 2); - load_elements(elements_rev, combo_file, 2) || - load_elements(elements_rev, "bin/" combo_file, 2); + load_elements(elements_rev, "../elem_data/" combo_file, 3); + load_elements(elements_rev, combo_file, 3) || + load_elements(elements_rev, "bin/" combo_file, 3); load_elements(polls, "../elem_data/" poll_file, 2);