From 9c6a166fa2b00a1ab177d9e9216a839b87e36ca7 Mon Sep 17 00:00:00 2001 From: Frederico Linhares Date: Thu, 26 May 2022 14:56:47 -0300 Subject: fixt Remove duplicated error message --- src/main.cpp | 13 ++++++++----- 1 file 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(); -- cgit v1.2.3