Check if player is actually in biz before forcing exit

This commit is contained in:
Vortrex
2022-08-16 11:49:12 -05:00
parent fe4dfdcf4e
commit 54c07ccb65

View File

@@ -2281,11 +2281,13 @@ function deleteBusiness(businessId, whoDeleted = 0) {
* @return {Boolean} Whether or not the players were forced to exit * @return {Boolean} Whether or not the players were forced to exit
* *
*/ */
function removePlayersFromBusiness(businessId) { function removePlayersFromBusiness(businessIndex) {
getClients().forEach(function (client) { getClients().forEach(function (client) {
if (doesBusinessHaveInterior(businessId)) { if (doesBusinessHaveInterior(businessIndex)) {
if (getPlayerBusiness(client) == businessId) { if (getPlayerBusiness(client) == businessIndex) {
exitBusiness(client); if (getPlayerInterior(client) == getBusinessData(businessIndex).exitInterior && getPlayerDimension(client) == getBusinessData(businessIndex).exitDimension) {
exitBusiness(client);
}
} }
} }
}); });