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) {
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;
}
// ===========================================================================