1
mirror of https://github.com/thepeacockproject/Peacock synced 2025-03-27 11:12:44 +01:00

Add assertion that game version is provided in campaigns

Signed-off-by: Reece Dunham <me@rdil.rocks>
This commit is contained in:
Reece Dunham 2023-04-02 00:25:32 -04:00
parent 3421ee385b
commit a1961521fd
No known key found for this signature in database
GPG Key ID: F087CB485320F19F

@ -29,6 +29,7 @@ import type {
import { log, LogLevel } from "../loggingInterop"
import { getConfig } from "../configSwizzleManager"
import { fastClone } from "../utils"
import assert from "assert"
/* eslint-disable prefer-const */
@ -37,6 +38,15 @@ const genSingleMissionFactory = (userId: string): GenSingleMissionFunc => {
contractId: string,
gameVersion: GameVersion,
): ICampaignMission {
assert.ok(
contractId,
"Plugin tried to generate mission with no contract ID",
)
assert.ok(
gameVersion,
"Plugin tried to generate mission with no game version",
)
const actualContractData = controller.resolveContract(contractId)
if (!actualContractData) {