Don't delete houses

This commit is contained in:
Vortrex
2022-06-07 10:26:43 -05:00
parent 4cee525633
commit b15b14fdf4

View File

@@ -544,7 +544,7 @@ function deleteHouse(houseId, whoDeleted = 0) {
let dbQuery = null; let dbQuery = null;
if (dbConnection) { if (dbConnection) {
dbQuery = queryDatabase(dbConnection, `DELETE FROM house_main WHERE house_id = ${tempHouseData.databaseId}`); dbQuery = queryDatabase(dbConnection, `UPDATE house_main SET house_deleted = 1, house_when_deleted = UNIX_TIMESTAMP(), house_who_deleted = ${whoDeleted} WHERE house_id = ${tempHouseData.databaseId}`);
if (dbQuery) { if (dbQuery) {
freeDatabaseQuery(dbQuery); freeDatabaseQuery(dbQuery);
} }
@@ -659,7 +659,10 @@ function getClosestHouseExit(position, dimension) {
// =========================================================================== // ===========================================================================
function getPlayerHouse(client) { function getPlayerHouse(client) {
if(getServerData().houses.length > 0) { if (getServerData().houses.length == 0) {
return -1;
}
if (getPlayerDimension(client) == getGameConfig().mainWorldDimension[getGame()]) { if (getPlayerDimension(client) == getGameConfig().mainWorldDimension[getGame()]) {
let closestEntrance = getClosestHouseEntrance(getPlayerPosition(client), getPlayerDimension(client)); let closestEntrance = getClosestHouseEntrance(getPlayerPosition(client), getPlayerDimension(client));
if (getDistance(getPlayerPosition(client), getHouseData(closestEntrance).entrancePosition) <= getGlobalConfig().enterPropertyDistance) { if (getDistance(getPlayerPosition(client), getHouseData(closestEntrance).entrancePosition) <= getGlobalConfig().enterPropertyDistance) {
@@ -677,7 +680,6 @@ function getPlayerHouse(client) {
} }
} }
} }
}
return -1; return -1;
} }
@@ -847,6 +849,10 @@ function createHouseEntrancePickup(houseId) {
return false; return false;
} }
if (!isGameFeatureSupported("pickups")) {
return false;
}
if (!getHouseData(houseId)) { if (!getHouseData(houseId)) {
return false; return false;
} }
@@ -900,6 +906,10 @@ function createHouseEntranceBlip(houseId) {
return false; return false;
} }
if (!isGameFeatureSupported("blips")) {
return false;
}
if (!getHouseData(houseId)) { if (!getHouseData(houseId)) {
return false; return false;
} }
@@ -953,6 +963,10 @@ function createHouseExitPickup(houseId) {
return false; return false;
} }
if (!isGameFeatureSupported("pickups")) {
return false;
}
if (!getHouseData(houseId)) { if (!getHouseData(houseId)) {
return false; return false;
} }
@@ -997,6 +1011,10 @@ function createHouseExitBlip(houseId) {
return false; return false;
} }
if (!isGameFeatureSupported("blips")) {
return false;
}
if (!getHouseData(houseId)) { if (!getHouseData(houseId)) {
return false; return false;
} }