mirror of
https://github.com/thepeacockproject/Peacock
synced 2025-04-15 21:31:11 +02:00
Add assertion that game version is provided in campaigns
Signed-off-by: Reece Dunham <me@rdil.rocks>
This commit is contained in:
parent
3421ee385b
commit
a1961521fd
@ -29,6 +29,7 @@ import type {
|
|||||||
import { log, LogLevel } from "../loggingInterop"
|
import { log, LogLevel } from "../loggingInterop"
|
||||||
import { getConfig } from "../configSwizzleManager"
|
import { getConfig } from "../configSwizzleManager"
|
||||||
import { fastClone } from "../utils"
|
import { fastClone } from "../utils"
|
||||||
|
import assert from "assert"
|
||||||
|
|
||||||
/* eslint-disable prefer-const */
|
/* eslint-disable prefer-const */
|
||||||
|
|
||||||
@ -37,6 +38,15 @@ const genSingleMissionFactory = (userId: string): GenSingleMissionFunc => {
|
|||||||
contractId: string,
|
contractId: string,
|
||||||
gameVersion: GameVersion,
|
gameVersion: GameVersion,
|
||||||
): ICampaignMission {
|
): 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)
|
const actualContractData = controller.resolveContract(contractId)
|
||||||
|
|
||||||
if (!actualContractData) {
|
if (!actualContractData) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user