Show item list on empty buy command

This commit is contained in:
Vortrex
2021-03-30 21:47:22 -05:00
parent a41e6ecb1e
commit 4617249334

View File

@@ -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!");