Fix logic when buying a limited amount of items with stacksize 99
This commit is contained in:
parent
fe4637e941
commit
eea9825723
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0-windows</TargetFramework>
|
<TargetFramework>net7.0-windows</TargetFramework>
|
||||||
<Version>2.25</Version>
|
<Version>2.26</Version>
|
||||||
<LangVersion>11.0</LangVersion>
|
<LangVersion>11.0</LangVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
|
@ -30,11 +30,15 @@ partial class DeliverooPlugin
|
|||||||
{
|
{
|
||||||
foreach (PurchaseItemRequest request in _itemsToPurchaseNow)
|
foreach (PurchaseItemRequest request in _itemsToPurchaseNow)
|
||||||
{
|
{
|
||||||
int offset = 0;
|
int toBuy = 0;
|
||||||
if (request == previousRequest)
|
if (request == previousRequest)
|
||||||
offset = (int)request.StackSize;
|
{
|
||||||
|
toBuy = (int)request.StackSize;
|
||||||
|
if (request.ItemId != ItemIds.Venture && !_configuration.IgnoreCertainLimitations)
|
||||||
|
toBuy = Math.Min(toBuy, 99);
|
||||||
|
}
|
||||||
|
|
||||||
if (GetItemCount(request.ItemId) + offset < request.EffectiveLimit)
|
if (GetItemCount(request.ItemId) + toBuy < request.EffectiveLimit)
|
||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user