fix: Fixes demolishing house for a deed (#2003)

### Summary

* Fixes players with no bank box failing to demolish their house.
* Fixes players getting a deed, and a house infinitely.
This commit is contained in:
Kamron Batman 2024-12-03 17:58:31 -08:00 • committed by GitHub
parent 1d08572926
commit ba2a41236c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 36 additions and 34 deletions

View file

@ -209,19 +209,19 @@ public partial class Banker : BaseVendor
public static bool Deposit(Mobile from, int amount)
{
// If for whatever reason the TOL checks fail, we should still try old methods for depositing currency.
if (AccountGold.Enabled && from.Account?.DepositGold(amount) == true)
if (amount <= 0 || AccountGold.Enabled && from.Account?.DepositGold(amount) == true)
{
return true;
}
var box = from.FindBankNoCreate();
var box = from.BankBox;
if (box == null)
{
return false;
}
var items = new List<Item>();
using var items = PooledRefQueue<Item>.Create();
while (amount > 0)
{
@ -244,14 +244,14 @@ public partial class Banker : BaseVendor
if (box.TryDropItem(from, item, false))
{
items.Add(item);
items.Enqueue(item);
}
else
{
item.Delete();
foreach (var curItem in items)
while (items.Count > 0)
{
curItem.Delete();
items.Dequeue().Delete();
}
return false;