fix: remove credits & ducats for purchases from baro
All checks were successful
Build / build (18) (push) Successful in 44s
Build / build (20) (push) Successful in 1m3s
Build / build (22) (push) Successful in 1m15s
Build / build (18) (pull_request) Successful in 47s
Build / build (20) (pull_request) Successful in 1m4s
Build / build (22) (pull_request) Successful in 1m17s
All checks were successful
Build / build (18) (push) Successful in 44s
Build / build (20) (push) Successful in 1m3s
Build / build (22) (push) Successful in 1m15s
Build / build (18) (pull_request) Successful in 47s
Build / build (20) (pull_request) Successful in 1m4s
Build / build (22) (pull_request) Successful in 1m17s
This commit is contained in:
parent
8728cf3abf
commit
e46711841f
@ -134,6 +134,29 @@ export const handlePurchase = async (
|
|||||||
};
|
};
|
||||||
|
|
||||||
switch (purchaseRequest.PurchaseParams.Source) {
|
switch (purchaseRequest.PurchaseParams.Source) {
|
||||||
|
case 1: {
|
||||||
|
if (purchaseRequest.PurchaseParams.SourceId! != worldState.VoidTraders[0]._id.$oid) {
|
||||||
|
throw new Error("invalid request source");
|
||||||
|
}
|
||||||
|
const offer = worldState.VoidTraders[0].Manifest.find(
|
||||||
|
x => x.ItemType == purchaseRequest.PurchaseParams.StoreItem
|
||||||
|
);
|
||||||
|
if (offer) {
|
||||||
|
combineInventoryChanges(
|
||||||
|
purchaseResponse.InventoryChanges,
|
||||||
|
updateCurrency(inventory, offer.RegularPrice, false)
|
||||||
|
);
|
||||||
|
|
||||||
|
const invItem: IMiscItem = {
|
||||||
|
ItemType: "/Lotus/Types/Items/MiscItems/PrimeBucks",
|
||||||
|
ItemCount: offer.PrimePrice * purchaseRequest.PurchaseParams.Quantity * -1
|
||||||
|
};
|
||||||
|
addMiscItems(inventory, [invItem]);
|
||||||
|
purchaseResponse.InventoryChanges.MiscItems ??= [];
|
||||||
|
purchaseResponse.InventoryChanges.MiscItems.push(invItem);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
const syndicateTag = purchaseRequest.PurchaseParams.SyndicateTag!;
|
const syndicateTag = purchaseRequest.PurchaseParams.SyndicateTag!;
|
||||||
|
@ -14,7 +14,7 @@ export interface IPurchaseRequest {
|
|||||||
|
|
||||||
export interface IPurchaseParams {
|
export interface IPurchaseParams {
|
||||||
Source: number;
|
Source: number;
|
||||||
SourceId?: string; // for Source 7 & 18
|
SourceId?: string; // for Source 1, 7 & 18
|
||||||
StoreItem: string;
|
StoreItem: string;
|
||||||
StorePage: string;
|
StorePage: string;
|
||||||
SearchTerm: string;
|
SearchTerm: string;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user