From 23c938eb4b7f387625553d6d67954c955861ce40 Mon Sep 17 00:00:00 2001
From: Jesusaves <cpntb1@ymail.com>
Date: Mon, 24 May 2021 23:09:09 -0300
Subject: Make Vault functions reliant on $BETASERVER flag

---
 npc/functions/hub.txt   | 2 +-
 npc/functions/vault.txt | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

(limited to 'npc')

diff --git a/npc/functions/hub.txt b/npc/functions/hub.txt
index 5461c4bd5..fdccd482d 100644
--- a/npc/functions/hub.txt
+++ b/npc/functions/hub.txt
@@ -228,7 +228,7 @@ function	script	HUB_Logout	{
     if (!.@dead) {
         CHAREG_CLEANUP=gettimetick(2);
         // Send updates to Vault API
-        if (##VAULT) {
+        if (getvaultid()) {
             .@api$=json_encode("UID", ##VAULT,
                                "GID", getcharid(3),
                                "VAR1N", "MLQUEST",
diff --git a/npc/functions/vault.txt b/npc/functions/vault.txt
index 55ae5ae9f..ec69c435f 100644
--- a/npc/functions/vault.txt
+++ b/npc/functions/vault.txt
@@ -4,12 +4,19 @@
 //  Description:
 //    Vault Utilities
 
+function	script	getvaultid	{
+    if ($BETASERVER)
+        return ##VAULT;
+    else
+        return 0;
+}
+
 function	script	getvaultexp	{
     .@exp=getarg(0);
     if (.@exp > 100)
         Exception("ILLEGAL VAULT EXPERIENCE, FIXME URGENTLY. STOPPING SCRIPT BY FORCE WHILE DOING NOTHING.",
             RB_DEBUGMES | RB_IRCBROADCAST | RB_GLOBALANNOUNCE | RB_ISFATAL);
-    if (##VAULT) {
+    if (getvaultid()) {
         ##VAULT_EXP+=.@exp;
         debugmes("Granting %d Soul Exp to %d under the Moubootaur's authority.",
                  .@exp, ##VAULT);
-- 
cgit v1.2.3-70-g09d2