fix houses to be buyable by website only and rent would be taken from player balance

This commit is contained in:
ErikasKontenis
2020-01-23 21:02:43 +02:00
parent ad7a761167
commit aa779bbdd9
3 changed files with 11 additions and 44 deletions

View File

@@ -109,11 +109,6 @@ void House::updateDoorDescription() const
ss << "It belongs to house '" << houseName << "'. " << ownerName << " owns this house.";
} else {
ss << "It belongs to house '" << houseName << "'. Nobody owns this house.";
const int32_t housePrice = getRent();
if (housePrice != -1) {
ss << " It costs " << housePrice * 5 << " gold coins.";
}
}
for (const auto& it : doorSet) {
@@ -667,7 +662,9 @@ void Houses::payHouses(RentPeriod_t rentPeriod) const
continue;
}
if (g_game.removeMoney(player.getDepotLocker(house->getTownId(), true), house->getRent(), FLAG_NOLIMIT)) {
if (player.getBankBalance() >= rent) {
player.setBankBalance(player.getBankBalance() - rent);
time_t paidUntil = currentTime;
switch (rentPeriod) {
case RENTPERIOD_DAILY: