From 8499bfaf4f0e53e5a556b1ce819dfdda2084fec0 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sat, 2 Jan 2021 21:54:38 -0600 Subject: [PATCH] Add set data indexes func for businesses --- scripts/server/business.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/server/business.js b/scripts/server/business.js index a6b9931c..c8659153 100644 --- a/scripts/server/business.js +++ b/scripts/server/business.js @@ -13,6 +13,8 @@ function initBusinessScript() { getServerData().businesses = loadBusinessesFromDatabase(); createAllBusinessPickups(); createAllBusinessBlips(); + + setAllBusinessIndexes(); console.log("[Asshat.Business]: Business script initialized successfully!"); return true; } @@ -965,3 +967,11 @@ function reloadAllBusinessesCommand(command, params, client) { } // --------------------------------------------------------------------------- + +function setAllBusinessIndexes() { + for(let i in getServerData().businesses) { + getServerData().businesses[i].index = i; + } +} + +// ---------------------------------------------------------------------------