forked from liza/Deliveroo
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">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0-windows</TargetFramework>
|
||||
<Version>2.25</Version>
|
||||
<Version>2.26</Version>
|
||||
<LangVersion>11.0</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
|
@ -30,11 +30,15 @@ partial class DeliverooPlugin
|
||||
{
|
||||
foreach (PurchaseItemRequest request in _itemsToPurchaseNow)
|
||||
{
|
||||
int offset = 0;
|
||||
int toBuy = 0;
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user