fix issue with empty levels
@@ -4,6 +4,11 @@ extract import "constants.spwn"
type @level_info;
let lvlstr = $.split_str($.level_string(), ";").map(x => $.split_str(x, ","))
+if lvlstr.length == 0 {
+ impl @level_info {
+ objects: []
+ }
+} else {
let [*[obj_keys, obj_values]] = lvlstr[1:2:-1].map(x => [x[:2:], x[1:2:]])
let obj_list = obj_keys.map_index((x, i) => [*[x, obj_values[i]]])
impl @level_info {
@@ -35,6 +40,7 @@ impl @level_info {
return objs;
}()
}
+}
return {}
\ No newline at end of file
