diff --git a/scripts/client/house.js b/scripts/client/house.js index 39e2d391..720931f7 100644 --- a/scripts/client/house.js +++ b/scripts/client/house.js @@ -25,10 +25,19 @@ class HouseData { // =========================================================================== -function receiveHouseFromServer(houseId, description, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked) { +function receiveHouseFromServer(houseId, isDeleted, description, entrancePosition, blipModel, pickupModel, buyPrice, rentPrice, hasInterior, locked) { logToConsole(LOG_DEBUG, `[V.RP.House] Received house ${houseId} (${name}) from server`); if (!areServerElementsSupported() || getGame() == V_GAME_MAFIA_ONE || getGame() == V_GAME_GTA_IV) { + if (isDeleted == true) { + if (getGame() == V_GAME_GTA_IV) { + natives.removeBlipAndClearIndex(getHouseData(houseId).blipId); + } + + getServerData().houses.splice(houseId, 1); + return false; + } + if (getHouseData(houseId) != false) { let houseData = getHouseData(houseId); houseData.description = description; @@ -46,7 +55,11 @@ function receiveHouseFromServer(houseId, description, entrancePosition, blipMode if (houseData.rentPrice > 0) { houseData.labelInfoType = V_PROPLABEL_INFO_RENTHOUSE; } else { - houseData.labelInfoType = V_PROPLABEL_INFO_ENTER; + if (houseData.hasInterior) { + houseData.labelInfoType = V_PROPLABEL_INFO_ENTER; + } else { + houseData.labelInfoType = V_PROPLABEL_INFO_NONE; + } } } @@ -124,4 +137,10 @@ function setAllHouseDataIndexes() { } } +// =========================================================================== + +function removeHousesFromClient() { + getServerData().houses.splice(0); +} + // =========================================================================== \ No newline at end of file