summaryrefslogtreecommitdiff
path: root/npc/functions/util.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/util.txt')
-rw-r--r--npc/functions/util.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/npc/functions/util.txt b/npc/functions/util.txt
index 05699b68a..d3aebb7d1 100644
--- a/npc/functions/util.txt
+++ b/npc/functions/util.txt
@@ -1307,8 +1307,11 @@ function script json_encode {
// sends to API
function script api_send {
.@cde=getarg(0);
- .@fm$=escape_sql(getarg(1));
- query_sql("INSERT INTO `api_export` (`type`, `data`) VALUES ('"+.@cde+"', \""+.@fm$+"\")");
+ if (!apicall(.@cde, getarg(1))) {
+ debugmes "[API] Fallback in use.";
+ .@fm$=escape_sql(getarg(1));
+ query_sql("INSERT INTO `api_export` (`type`, `data`) VALUES ('"+.@cde+"', \""+.@fm$+"\")");
+ }
return;
}