summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrederico Linhares <fred@linhares.blue>2022-05-26 14:56:47 -0300
committerFrederico Linhares <fred@linhares.blue>2022-05-26 14:56:47 -0300
commit9c6a166fa2b00a1ab177d9e9216a839b87e36ca7 (patch)
tree310251b9479b1ff9a72d4c8fac30e6b77b1d22e0 /src
parent5baa7560704117c5528c9903c218df73793c8a33 (diff)
fixt Remove duplicated error message
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();