Vendomatic

Vendomatic

95.1k Downloads

Guild Bank limited funds causes error on auto-repair

miketheitguy opened this issue ยท 3 comments

commented

One more bug I'd like to report regarding guild bank repairs. If the guild bank does not have enough money to repair you, it should repair from the character's funds, but it just fails.

commented

Probably an error or event that fires when this happens.

commented

Vendomatic/Vendomatic.lua

Lines 100 to 153 in aba7d23

--Need to cleanup - WTF was I thinking with such a messy function?
function Vendomatic_AutoRepair()
local repaircost = GetRepairAllCost();
local withdrawLimit = GetGuildBankWithdrawMoney();
if (repaircost == 0) then
print("|cffffd200Vend-o-matic|r: No repair needed");
end
if (repaircost > 0) then
if (VendomaticOptions.repairtype == 1) then
if CanGuildBankRepair() and (VendomaticOptions.guildbankrepair == 1) and (repaircost <= withdrawLimit) then
if IsGuildLeader() then
if (VendomaticOptions.gmbankrepair == 1) then
RepairAllItems(1);
print("|cffffd200Vend-o-matic|r: Repaired All Items with Guild Bank: " .. GetCoinTextureString(repaircost));
else
RepairAllItems();
print("|cffffd200Vend-o-matic|r: Repaired All Items: " .. GetCoinTextureString(repaircost));
end
else
RepairAllItems(1);
print("|cffffd200Vend-o-matic|r: Repaired All Items with Guild Bank: " .. GetCoinTextureString(repaircost));
end
else
RepairAllItems();
print("|cffffd200Vend-o-matic|r: Repaired All Items: " .. GetCoinTextureString(repaircost));
end
elseif (VendomaticOptions.repairtype == 2) then
Vendomatic_RepairConfirmationTextGold:SetText(GetCoinTextureString(repaircost));
Vendomatic_RepairConfirmation:Show();
elseif (VendomaticOptions.repairtype == 3) then
local repairdivide = (repaircost / GetMoney()) * 100;
if repairdivide > VendomaticOptions.repairthreshold then
Vendomatic_RepairConfirmationTextGold:SetText(GetCoinTextureString(repaircost));
Vendomatic_RepairConfirmation:Show();
else
if CanGuildBankRepair() and (VendomaticOptions.guildbankrepair == 1) and (repaircost <= withdrawLimit) then
if IsGuildLeader() then
if (VendomaticOptions.gmbankrepair == 1) then
RepairAllItems(1);
print("|cffffd200Vend-o-matic|r: Repaired All Items with Guild Bank: " .. GetCoinTextureString(repaircost));
else
RepairAllItems(1);
print("|cffffd200Vend-o-matic|r: Repaired All Items: " .. GetCoinTextureString(repaircost));
end
end
else
RepairAllItems();
print("|cffffd200Vend-o-matic|r: Repaired All Items: " .. GetCoinTextureString(repaircost));
end
end
end
end
end