summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 8ebe77c..900bb11 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -30,7 +30,7 @@
cg_sCore cg_core;
-void handle_error(mrb_state *mrb)
+static void handle_error(mrb_state *mrb)
{
mrb_print_error(mrb);
cg_core.quit_game = SDL_TRUE;
@@ -78,10 +78,13 @@ int main(int argc, char *argv[])
fp = fopen(argv[2], "r");
mrb_load_irep_file(mrb, fp);
fclose(fp);
- if (mrb->exc) handle_error(mrb);
-
- mrb_funcall_id(mrb, main_obj, sym_init, 0);
- if (mrb->exc) handle_error(mrb);
+ if (mrb->exc)
+ handle_error(mrb);
+ else
+ {
+ mrb_funcall_id(mrb, main_obj, sym_init, 0);
+ if (mrb->exc) handle_error(mrb);
+ }
frame_start = SDL_GetTicks();