attempt hotloading if element doesn't exist
This commit is contained in:
parent
8878053ee0
commit
c02e8aa59a
2 changed files with 10 additions and 1 deletions
|
@ -38,3 +38,4 @@ ocean;land;sea
|
||||||
planet;earth;ocean
|
planet;earth;ocean
|
||||||
planet;land;ocean
|
planet;land;ocean
|
||||||
star;fire;sky
|
star;fire;sky
|
||||||
|
pollution;air;dust
|
||||||
|
|
10
src/main.c
10
src/main.c
|
@ -56,6 +56,14 @@ int main(int argc, char *argv[]) {
|
||||||
uintptr_t result;
|
uintptr_t result;
|
||||||
hashmap_get(elements, command_re, strlen(command_re), &result);
|
hashmap_get(elements, command_re, strlen(command_re), &result);
|
||||||
|
|
||||||
|
// todo: better
|
||||||
|
if (result == 0) {
|
||||||
|
load_elements(elements, combo_file, 0) ||
|
||||||
|
load_elements(elements, "bin/" combo_file, 0);
|
||||||
|
|
||||||
|
hashmap_get(elements, command_re, strlen(command_re), &result);
|
||||||
|
}
|
||||||
|
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
printf("You didn't make anything.\n");
|
printf("You didn't make anything.\n");
|
||||||
continue;
|
continue;
|
||||||
|
@ -72,7 +80,7 @@ int main(int argc, char *argv[]) {
|
||||||
if (fptr == NULL)
|
if (fptr == NULL)
|
||||||
continue;
|
continue;
|
||||||
fwrite(res_str, sizeof(char), strlen(res_str), fptr);
|
fwrite(res_str, sizeof(char), strlen(res_str), fptr);
|
||||||
fwrite("\n",sizeof(char),1,fptr);
|
fwrite("\n", sizeof(char), 1, fptr);
|
||||||
fclose(fptr);
|
fclose(fptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue