1
mirror of https://github.com/thepeacockproject/Peacock synced 2024-11-22 22:12:45 +01:00

Fixed a nullability issue (#243)

This commit is contained in:
moonysolari 2023-04-22 05:13:26 -04:00 committed by GitHub
parent 35845c4b53
commit 75a4b259e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,7 @@ import { getUserData, writeUserData } from "./databaseHandler"
import { getConfig } from "./configSwizzleManager"
import { ContractProgressionData } from "./types/types"
import { getFlag } from "./flags"
import { EVERGREEN_LEVEL_INFO } from "./utils"
export async function setCpd(
data: ContractProgressionData,
@ -48,20 +49,13 @@ export async function getCpd(
false,
) as ContractProgressionData
//NOTE: Override the EvergreenLevel with the latest Mastery Level
if (getFlag("gameplayUnlockAllFreelancerMasteries")) {
//TODO: Get rid of hardcoded values
userData.Extensions.CPD[cpdID]["EvergreenLevel"] = 100
}
await setCpd(defaultCPD, uID, cpdID)
return defaultCPD
}
//NOTE: Override the EvergreenLevel with the latest Mastery Level
if (getFlag("gameplayUnlockAllFreelancerMasteries")) {
//TODO: Get rid of hardcoded values
userData.Extensions.CPD[cpdID]["EvergreenLevel"] = 100
userData.Extensions.CPD[cpdID]["EvergreenLevel"] =
EVERGREEN_LEVEL_INFO.length
}
return userData.Extensions.CPD[cpdID]