add inventory

This commit is contained in:
biglyderv 2025-03-24 22:27:02 -04:00
parent 7279afeb4c
commit 88e49d7ec8
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5
9 changed files with 79 additions and 17 deletions

View file

@ -6,7 +6,7 @@
#define MAX_FILE_SIZE 1024 * 16
void load_elements(hashmap *m, char *table) {
void load_elements(hashmap *m, char *table, int use_inv) {
FILE *fptr;
fptr = fopen(table, "r");
@ -18,6 +18,11 @@ void load_elements(hashmap *m, char *table) {
if (!fgets(str, MAX_FILE_SIZE, fptr))
break;
if (use_inv) {
hashmap_set(m, str, strlen(str) - 2, (uintptr_t)1);
continue;
}
char *combo = strstr(str, ";");
combo[0] = '\0';
combo++;