diff options
author | UnavailableDev <ggwildplay@gmail.com> | 2023-04-03 11:37:45 +0200 |
---|---|---|
committer | UnavailableDev <ggwildplay@gmail.com> | 2023-04-03 11:37:45 +0200 |
commit | f761624a95de538bb2be8f9449ed0edb8ae067ad (patch) | |
tree | b0224b1516a362c27903efd4797f9bdf1a7eabc6 /src/engine/level_const.c | |
parent | 05504df10934cac60b774fb10e86593ec3897510 (diff) | |
parent | cd9d3141626e7be29b69da15b989d23eb63e46f0 (diff) |
Merge branch 'game-engine' into dev
Diffstat (limited to 'src/engine/level_const.c')
-rw-r--r-- | src/engine/level_const.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/engine/level_const.c b/src/engine/level_const.c index 5ba0187..3847ad8 100644 --- a/src/engine/level_const.c +++ b/src/engine/level_const.c @@ -1,5 +1,6 @@ #include "engine/level_const.h" +#include <stdio.h> hh_g_all_levels hh_init_game_levels(){ hh_g_all_levels levels; @@ -14,6 +15,10 @@ hh_g_all_levels hh_init_game_levels(){ levels.level[1].hh_level_completed=false; FILE *fp = fopen("../test/bin/level1_test.bin", "rb"); + if (fp == NULL) { + printf("level1_test.bin not found!\n"); + return levels; + } fseek(fp, 0, SEEK_END); int size = ftell(fp) / sizeof(int); fseek(fp, (0 * sizeof(int)) + sizeof(int), SEEK_SET); @@ -22,6 +27,10 @@ hh_g_all_levels hh_init_game_levels(){ fclose(fp); FILE *lvl2 = fopen("../test/bin/level2_test.bin", "rb"); + if (lvl2 == NULL) { + printf("level2_test.bin not found!\n"); + return levels; + } fseek(lvl2, 0, SEEK_END); size = ftell(lvl2) / sizeof(int); fseek(lvl2, (0 * sizeof(int)) + sizeof(int), SEEK_SET); |