add inv saving, fix bugs

This commit is contained in:
biglyderv 2025-03-25 19:48:55 -04:00
parent 4bef1a220c
commit d5e55b54ee
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5
5 changed files with 26 additions and 10 deletions

View file

@ -26,7 +26,7 @@ int load_elements(hashmap *m, char *table, int use_inv) {
did_something = 1;
if (use_inv) {
hashmap_set(m, str, strlen(str) - 2, (uintptr_t)1);
hashmap_set(m, str, strlen(str) - 1, (uintptr_t)1);
continue;
}
@ -37,13 +37,12 @@ int load_elements(hashmap *m, char *table, int use_inv) {
hashmap_set(m, combo, strlen(combo) - 1, (uintptr_t)str);
}
printf("%i\n",did_something);
if (!did_something) {
free(str);
}
fclose(fptr);
return did_something;
// todo: properly free this