From 3dc3499a8c52d1698ff933965fc9d474491950dd Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Thu, 10 Feb 2022 00:41:03 +0000 Subject: [PATCH] issues/72 - Allow Zero amounts for the sale price is avatar is set. [SetParcelSale] --- Core/Commands/Parcel.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Core/Commands/Parcel.cs b/Core/Commands/Parcel.cs index ac9a2af..c95908e 100644 --- a/Core/Commands/Parcel.cs +++ b/Core/Commands/Parcel.cs @@ -38,11 +38,21 @@ namespace BetterSecondBot.HttpService { return Failure("Invaild amount", "SetParcelSale", new [] { amount, avatar }); } - if((amountvalue < 1) || (amountvalue > 9999999)) + + int minAmount = 1; + avataruuid = UUID.Zero; + if (avatar != "none") + { + ProcessAvatar(avatar); + if(avataruuid != UUID.Zero) + { + minAmount = 0; + } + } + if ((amountvalue < minAmount) || (amountvalue > 9999999)) { return Failure("Invaild amount", "SetParcelSale", new [] { amount, avatar }); } - ProcessAvatar(avatar); targetparcel.SalePrice = amountvalue; targetparcel.AuthBuyerID = avataruuid; parcel_static.ParcelSetFlag(ParcelFlags.ForSale, targetparcel, true);