diff --git a/Core/Commands/Parcel.cs b/Core/Commands/Parcel.cs index c95908e..e8f31c0 100644 --- a/Core/Commands/Parcel.cs +++ b/Core/Commands/Parcel.cs @@ -457,11 +457,20 @@ namespace BetterSecondBot.HttpService { return Failure(tests.Value, "ParcelBuy", new [] { amount }); } + if ((targetparcel.AuthBuyerID != UUID.Zero) && (targetparcel.AuthBuyerID != bot.GetClient.Self.AgentID)) + { + return Failure("Parcel sale locked to other avatars", "ParcelBuy", new[] { amount }); + } + int minAmount = 1; + if (targetparcel.AuthBuyerID != bot.GetClient.Self.AgentID) + { + minAmount = 0; + } if (int.TryParse(amount, out int amountvalue) == false) { return Failure("Invaild amount", "ParcelBuy", new [] { amount }); } - if (amountvalue < 1) + if (amountvalue < minAmount) { return Failure("Invaild amount", "ParcelBuy", new [] { amount }); }; @@ -469,10 +478,6 @@ namespace BetterSecondBot.HttpService { return Failure("Parcel not for sale", "ParcelBuy", new [] { amount }); } - if ((targetparcel.AuthBuyerID != UUID.Zero) && (targetparcel.AuthBuyerID != bot.GetClient.Self.AgentID)) - { - return Failure("Parcel sale locked to other avatars", "ParcelBuy", new [] { amount }); - } if (targetparcel.SalePrice != amountvalue) { return Failure("Parcel sale price and amount do not match", "ParcelBuy", new [] { amount });