add inventory
This commit is contained in:
parent
7279afeb4c
commit
88e49d7ec8
9 changed files with 79 additions and 17 deletions
|
@ -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++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue