chore: improve addMissionInventoryUpdates
All checks were successful
Build / build (20) (push) Successful in 59s
Build / build (18) (pull_request) Successful in 40s
Build / build (18) (push) Successful in 42s
Build / build (22) (push) Successful in 1m4s
Build / build (20) (pull_request) Successful in 59s
Build / build (22) (pull_request) Successful in 1m0s
All checks were successful
Build / build (20) (push) Successful in 59s
Build / build (18) (pull_request) Successful in 40s
Build / build (18) (push) Successful in 42s
Build / build (22) (push) Successful in 1m4s
Build / build (20) (pull_request) Successful in 59s
Build / build (22) (pull_request) Successful in 1m0s
"type this properly" & don't abort on mission failure
This commit is contained in:
parent
3853fda60d
commit
c2e5c9b581
@ -65,12 +65,8 @@ const getRandomRewardByChance = (pool: IReward[]): IRngResult | undefined => {
|
||||
export const addMissionInventoryUpdates = async (
|
||||
inventory: HydratedDocument<IInventoryDatabase, InventoryDocumentProps>,
|
||||
inventoryUpdates: IMissionInventoryUpdateRequest
|
||||
): Promise<Partial<IInventoryDatabase> | undefined> => {
|
||||
//TODO: type this properly
|
||||
const inventoryChanges: Partial<IInventoryDatabase> = {};
|
||||
if (inventoryUpdates.MissionFailed === true) {
|
||||
return;
|
||||
}
|
||||
): Promise<IInventoryChanges> => {
|
||||
const inventoryChanges: IInventoryChanges = {};
|
||||
if (inventoryUpdates.RewardInfo && inventoryUpdates.RewardInfo.periodicMissionTag) {
|
||||
const tag = inventoryUpdates.RewardInfo.periodicMissionTag;
|
||||
const existingCompletion = inventory.PeriodicMissionCompletions.find(completion => completion.tag === tag);
|
||||
|
Loading…
x
Reference in New Issue
Block a user