From 46172493346a6ecb4fe9e12a4d3e53dfac3887c9 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 30 Mar 2021 21:47:22 -0500 Subject: [PATCH] Show item list on empty buy command --- scripts/server/business.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/server/business.js b/scripts/server/business.js index d36f6666..f0a286a5 100644 --- a/scripts/server/business.js +++ b/scripts/server/business.js @@ -1155,13 +1155,15 @@ function addToBusinessInventory(businessId, itemType, amount, buyPrice) { // =========================================================================== function buyFromBusinessCommand(command, params, client) { + let businessId = getBusinessFromParams(isPlayerInAnyBusiness(client)) ? getPlayerBusiness(client) : getClosestBusinessEntrance(getPlayerPosition(client)); + if(areParamsEmpty(params)) { + showBusinessFloorInventoryToPlayer(client, businessId); messagePlayerSyntax(client, getCommandSyntaxText(command)); return false; } let splitParams = params.split(" "); - let businessId = getBusinessFromParams(splitParams[2]) || (isPlayerInAnyBusiness(client)) ? getPlayerBusiness(client) : getClosestBusinessEntrance(getPlayerPosition(client)); if(!getBusinessData(businessId)) { messagePlayerError(client, "Business not found!");