]> git.lizzy.rs Git - nothing.git/blobdiff - src/game/level_script.c
Merge pull request #621 from tsoding/615
[nothing.git] / src / game / level_script.c
index c62281387bcfb27106b1a3a44f126463a374ed87..97654e843c666204b356b540de9fe97c78cb1b60 100644 (file)
@@ -1,4 +1,4 @@
-#include <assert.h>
+#include "system/stacktrace.h"
 
 #include "ebisp/gc.h"
 #include "ebisp/interpreter.h"
@@ -8,52 +8,12 @@
 #include "level_script.h"
 #include "system/log.h"
 
-static struct EvalResult
-hide_goal(void *param, Gc *gc, struct Scope *scope, struct Expr args)
-{
-    assert(param);
-    assert(gc);
-    assert(scope);
-
-    Level * const level = (Level*)param;
-    char * goal_id = NULL;
-
-    struct EvalResult result = match_list(gc, "s", args, &goal_id);
-    if (result.is_error) {
-        return result;
-    }
-
-    level_hide_goal(level, goal_id);
-
-    return eval_success(NIL(gc));
-}
-
-static struct EvalResult
-show_goal(void *param, Gc *gc, struct Scope *scope, struct Expr args)
-{
-    assert(param);
-    assert(gc);
-    assert(scope);
-
-    Level * const level = (Level*)param;
-    const char *goal_id = NULL;
-
-    struct EvalResult result = match_list(gc, "s", args, &goal_id);
-    if (result.is_error) {
-        return result;
-    }
-
-    level_show_goal(level, goal_id);
-
-    return eval_success(NIL(gc));
-}
-
 static struct EvalResult
 rect_apply_force(void *param, Gc *gc, struct Scope *scope, struct Expr args)
 {
-    assert(gc);
-    assert(scope);
-    assert(param);
+    trace_assert(gc);
+    trace_assert(scope);
+    trace_assert(param);
 
     Level *level = (Level*) param;
 
@@ -85,9 +45,9 @@ rect_apply_force(void *param, Gc *gc, struct Scope *scope, struct Expr args)
 static struct EvalResult
 hide_label(void *param, Gc *gc, struct Scope *scope, struct Expr args)
 {
-    assert(param);
-    assert(gc);
-    assert(scope);
+    trace_assert(param);
+    trace_assert(gc);
+    trace_assert(scope);
 
     Level *level = (Level*) param;
     const char *label_id = NULL;
@@ -109,16 +69,6 @@ void load_level_library(Gc *gc, struct Scope *scope, Level *level)
         scope,
         SYMBOL(gc, "rect-apply-force"),
         NATIVE(gc, rect_apply_force, level));
-    set_scope_value(
-        gc,
-        scope,
-        SYMBOL(gc, "hide-goal"),
-        NATIVE(gc, hide_goal, level));
-    set_scope_value(
-        gc,
-        scope,
-        SYMBOL(gc, "show-goal"),
-        NATIVE(gc, show_goal, level));
     set_scope_value(
         gc,
         scope,