diff --git a/scripts/server/house.js b/scripts/server/house.js index 6cb66f7e..ce69dc8c 100644 --- a/scripts/server/house.js +++ b/scripts/server/house.js @@ -404,8 +404,8 @@ function getClosestHouseEntrance(position) { // =========================================================================== function getPlayerHouse(client) { - if(getPlayerData(client).inHouse > 0) { - return getPlayerData(client).inHouse; + if(doesEntityDataExist(client, "ag.inHouse")) { + return getEntityData(client, "ag.inHouse"); } return false; @@ -648,11 +648,7 @@ function getHouseInfoCommand(command, params, client) { // =========================================================================== function isPlayerInAnyHouse(client) { - if(getPlayerData(client).inHouse > 0) { - return true; - } - - return false; + return doesEntityDataExist(client, "ag.inHouse"); } // =========================================================================== @@ -743,7 +739,7 @@ function exitHouse(client) { setPlayerDimension(client, getServerData().house[houseId].entranceDimension); setPlayerPosition(client, getServerData().house[houseId].entrancePosition); } - getPlayerData(client).inHouse = 0; + removeEntityData(client, "ag.inHouse"); } // =========================================================================== @@ -774,16 +770,4 @@ function cacheHouseItems(houseId) { } } -// =========================================================================== - -function getHouseIdFromDatabaseId(databaseId) { - for(let i in getServerData().houses) { - if(getHouseData(i).databaseId == databaseId) { - return i; - } - } - - return false; -} - // =========================================================================== \ No newline at end of file