Use radio station index

This commit is contained in:
Vortrex
2022-07-30 08:16:46 -05:00
parent 215124a0bc
commit ab4339c46b

View File

@@ -65,7 +65,8 @@ class HouseData {
this.exitPickup = null;
this.exitBlip = null;
this.streamingRadioStation = -1;
this.streamingRadioStation = 0;
this.streamingRadioStationIndex = -1;
if (dbAssoc) {
this.databaseId = toInteger(dbAssoc["house_id"]);
@@ -902,6 +903,7 @@ function saveHouseToDatabase(houseId) {
["house_has_interior", boolToInt(tempHouseData.hasInterior)],
["house_interior_lights", boolToInt(tempHouseData.interiorLights)],
["house_custom_interior", boolToInt(tempHouseData.customInterior)],
["house_radio_station", boolToInt(tempHouseData.streamingRadioStation)],
];
let dbQuery = null;
@@ -1809,4 +1811,23 @@ function createHousePickups(houseId) {
createHouseExitPickup(houseId);
}
// ===========================================================================
/**
* Gets whether or not a client is in a business
*
* @param {Client} client - The client to check whether or not is in a business
* @return {Boolean} Whether or not the client is in a business
*
*/
function isPlayerInAnyHouse(client) {
for (let i in getServerData().houses) {
if (getServerData().houses[i].hasInterior && getServerData().houses[i].exitDimension == getPlayerDimension(client)) {
return i;
}
}
return false;
}
// ===========================================================================