From 54c07ccb65daf9ba8914f33b0e7f45e9714b606a Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 16 Aug 2022 11:49:12 -0500 Subject: [PATCH] Check if player is actually in biz before forcing exit --- scripts/server/business.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/server/business.js b/scripts/server/business.js index 84b02903..ea801d8c 100644 --- a/scripts/server/business.js +++ b/scripts/server/business.js @@ -2281,11 +2281,13 @@ function deleteBusiness(businessId, whoDeleted = 0) { * @return {Boolean} Whether or not the players were forced to exit * */ -function removePlayersFromBusiness(businessId) { +function removePlayersFromBusiness(businessIndex) { getClients().forEach(function (client) { - if (doesBusinessHaveInterior(businessId)) { - if (getPlayerBusiness(client) == businessId) { - exitBusiness(client); + if (doesBusinessHaveInterior(businessIndex)) { + if (getPlayerBusiness(client) == businessIndex) { + if (getPlayerInterior(client) == getBusinessData(businessIndex).exitInterior && getPlayerDimension(client) == getBusinessData(businessIndex).exitDimension) { + exitBusiness(client); + } } } });