reverse path order

This commit is contained in:
biglyderv 2025-04-02 20:32:44 -04:00
parent 7a63fcb376
commit ed50d4daba
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5
2 changed files with 14 additions and 4 deletions

View file

@ -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;
}

View file

@ -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);