From 04179fcd262b8fa61b175bffea2492ef0d7cdd72 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Mon, 29 May 2023 11:52:17 +0300 Subject: [PATCH 1/2] Adding UNWRAP macro which removes config surrounding braces --- macro.inc.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/macro.inc.php b/macro.inc.php index 460a527..bb0bec4 100644 --- a/macro.inc.php +++ b/macro.inc.php @@ -142,7 +142,7 @@ function macro_BOOL($jsm, $expr) */ function macro_IS_DEV($jsm) { - return taskman_propor("GAME_IS_DEV", 0); + return \taskman\getor("GAME_IS_DEV", 0); } /** @@ -161,3 +161,13 @@ function macro_ITEM($proc, $proto_id, $amount) return array('proto_id' => $proto_id, 'amount' => $amount); } +/** + * @global @raw_args + */ +function macro_UNWRAP($jsm, $content) +{ + $content = trim($content); + $content = ltrim($content, '{'); + $content = rtrim($content, '}'); + return $content; +} From d079c79d50155aad98a9f71334eb223307a65e0c Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Fri, 2 Jun 2023 15:33:30 +0300 Subject: [PATCH 2/2] Removing non-working stuff --- macro.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macro.inc.php b/macro.inc.php index bb0bec4..3e718f4 100644 --- a/macro.inc.php +++ b/macro.inc.php @@ -114,7 +114,7 @@ function macro_SELF_CONF_ID($jsm) $proto_id = 0; $alias = ""; if(!\taskman\config_get_header($file, $proto_id, $alias)) - $proto_id = \taskman\config_get_id($file); + throw new Exception("No valid header for config: $file"); return $proto_id; }