From 4f37637adca376412a473ca22236c55ec99546e4 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Tue, 3 May 2022 12:05:53 -0500 Subject: [PATCH] Fix house lights + fix lights saving + lowercase biz lights msg --- scripts/server/misc.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/scripts/server/misc.js b/scripts/server/misc.js index c9350725..6b614f20 100644 --- a/scripts/server/misc.js +++ b/scripts/server/misc.js @@ -802,6 +802,7 @@ function lockCommand(command, params, client) { } getBusinessData(businessId).interiorLights = !getBusinessData(businessId).interiorLights; + getBusinessData(businessId).needsSaved = true; let clients = getClients(); for(let i in clients) { @@ -810,9 +811,7 @@ function lockCommand(command, params, client) { } } - getBusinessData(businessId).needsSaved = true; - - meActionToNearbyPlayers(client, `turned ${getOnOffFromBool((getBusinessData(businessId).interiorLights))} on the business lights`); + meActionToNearbyPlayers(client, `turned ${toLowerCase(getOnOffFromBool((getBusinessData(businessId).interiorLights)))} on the business lights`); return true; } @@ -823,7 +822,8 @@ function lockCommand(command, params, client) { return false; } - getHouseData(businessId).interiorLights = !getHouseData(houseId).interiorLights; + getHouseData(houseId).interiorLights = !getHouseData(houseId).interiorLights; + getHouseData(houseId).needsSaved = true; let clients = getClients(); for(let i in clients) { @@ -832,9 +832,7 @@ function lockCommand(command, params, client) { } } - getHouseData(houseId).needsSaved = true; - - meActionToNearbyPlayers(client, `turned ${getOnOffFromBool((getHouseData(houseId).interiorLights))} on the house lights`); + meActionToNearbyPlayers(client, `turned ${toLowerCase(getOnOffFromBool((getHouseData(houseId).interiorLights)))} on the house lights`); return true; } }