remove inv duping
This commit is contained in:
parent
fe1de151ff
commit
15f6ca9715
1 changed files with 9 additions and 0 deletions
|
@ -101,6 +101,15 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
char *res_str = (char *)result;
|
||||
|
||||
uintptr_t result2;
|
||||
|
||||
hashmap_get(inv, res_str, strlen(res_str), &result2);
|
||||
|
||||
if (result2 == 1) {
|
||||
printf("You made %s, but you already have it.\n", res_str);
|
||||
continue;
|
||||
}
|
||||
|
||||
hashmap_set(inv, res_str, strlen(res_str), (uintptr_t)1, 0);
|
||||
printf("You made %s!\n", res_str);
|
||||
|
||||
|
|
Loading…
Reference in a new issue