Fix fence item not being removed after purchase
This commit is contained in:
parent
e6e77d49a5
commit
796d63b3e2
@ -904,6 +904,7 @@ export class FenceService
|
|||||||
*/
|
*/
|
||||||
public amendOrRemoveFenceOffer(assortId: string, buyCount: number): void
|
public amendOrRemoveFenceOffer(assortId: string, buyCount: number): void
|
||||||
{
|
{
|
||||||
|
let isNormalAssort = true;
|
||||||
let fenceAssortItem = this.fenceAssort.items.find(item => item._id === assortId);
|
let fenceAssortItem = this.fenceAssort.items.find(item => item._id === assortId);
|
||||||
if (!fenceAssortItem)
|
if (!fenceAssortItem)
|
||||||
{
|
{
|
||||||
@ -915,12 +916,13 @@ export class FenceService
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
isNormalAssort = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Player wants to buy whole stack, delete stack
|
// Player wants to buy whole stack, delete stack
|
||||||
if (fenceAssortItem.upd.StackObjectsCount === buyCount)
|
if (fenceAssortItem.upd.StackObjectsCount === buyCount)
|
||||||
{
|
{
|
||||||
this.deleteOffer(assortId, this.fenceAssort.items);
|
this.deleteOffer(assortId, isNormalAssort ? this.fenceAssort.items : this.fenceDiscountAssort.items);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user