From c84dd08c4bf012b85466523618ff7657371c41f5 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Sun, 1 May 2022 15:06:39 -0500 Subject: [PATCH] Fix lock and lights cmds --- scripts/server/misc.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/server/misc.js b/scripts/server/misc.js index f348c2a2..c9350725 100644 --- a/scripts/server/misc.js +++ b/scripts/server/misc.js @@ -706,7 +706,7 @@ function lockCommand(command, params, client) { } let businessId = getPlayerBusiness(client); - if(businessId != false) { + if(businessId != -1) { if(!canPlayerManageBusiness(client, businessId)) { messagePlayerError(client, getLocaleString(client, "CantModifyBusiness")); return false; @@ -721,7 +721,7 @@ function lockCommand(command, params, client) { } let houseId = getPlayerHouse(client); - if(houseId != false) { + if(houseId != -1) { if(!canPlayerManageHouse(client, houseId)) { messagePlayerError(client, getLocaleString(client, "CantModifyHouse")); return false; @@ -734,7 +734,6 @@ function lockCommand(command, params, client) { messagePlayerSuccess(client, `House {houseGreen}${getHouseData(houseId).description} {MAINCOLOUR}${getLockedUnlockedFromBool((getHouseData(houseId).locked))}!`); return true; } - } } @@ -796,7 +795,7 @@ function lockCommand(command, params, client) { */ let businessId = getPlayerBusiness(client); - if(businessId != false) { + if(businessId != -1) { if(!canPlayerManageBusiness(client, businessId)) { messagePlayerError(client, getLocaleString(client, "CantModifyBusiness")); return false; @@ -807,7 +806,7 @@ function lockCommand(command, params, client) { let clients = getClients(); for(let i in clients) { if(getPlayerBusiness(client) == getPlayerBusiness(clients[i]) && getPlayerDimension(clients[i]) == getBusinessData(businessId).exitDimension) { - setPlayerInteriorLights(clients[i], getBusinessData(businessId).interiorLights); + updateInteriorLightsForPlayer(clients[i], getBusinessData(businessId).interiorLights); } } @@ -818,7 +817,7 @@ function lockCommand(command, params, client) { } let houseId = getPlayerHouse(client); - if(houseId != false) { + if(houseId != -1) { if(!canPlayerManageHouse(client, houseId)) { messagePlayerError(client, getLocaleString(client, "CantModifyHouse")); return false; @@ -829,7 +828,7 @@ function lockCommand(command, params, client) { let clients = getClients(); for(let i in clients) { if(getPlayerHouse(client) == getPlayerHouse(clients[i]) && getPlayerDimension(clients[i]) == getHouseData(houseId).exitDimension) { - setPlayerInteriorLights(clients[i], getHouseData(houseId).interiorLights); + updateInteriorLightsForPlayer(clients[i], getHouseData(houseId).interiorLights); } }