Revert "Use new inHouse in player data"

This reverts commit e249009fc2.
This commit is contained in:
Vortrex
2021-04-23 19:37:34 -05:00
parent 5d6f5ff782
commit bc3c5fc19c

View File

@@ -404,8 +404,8 @@ function getClosestHouseEntrance(position) {
// =========================================================================== // ===========================================================================
function getPlayerHouse(client) { function getPlayerHouse(client) {
if(getPlayerData(client).inHouse > 0) { if(doesEntityDataExist(client, "ag.inHouse")) {
return getPlayerData(client).inHouse; return getEntityData(client, "ag.inHouse");
} }
return false; return false;
@@ -648,11 +648,7 @@ function getHouseInfoCommand(command, params, client) {
// =========================================================================== // ===========================================================================
function isPlayerInAnyHouse(client) { function isPlayerInAnyHouse(client) {
if(getPlayerData(client).inHouse > 0) { return doesEntityDataExist(client, "ag.inHouse");
return true;
}
return false;
} }
// =========================================================================== // ===========================================================================
@@ -743,7 +739,7 @@ function exitHouse(client) {
setPlayerDimension(client, getServerData().house[houseId].entranceDimension); setPlayerDimension(client, getServerData().house[houseId].entranceDimension);
setPlayerPosition(client, getServerData().house[houseId].entrancePosition); 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;
}
// =========================================================================== // ===========================================================================