Engine api
This commit is contained in:
@@ -28,6 +28,7 @@ import {
|
||||
validate_tag,
|
||||
} from "./mod_data.ts";
|
||||
import type { ModData } from "./mod_loader.ts";
|
||||
import { ENGINE_GLOBAL } from "./hooks.ts";
|
||||
|
||||
export const BMOD_EXTENSION = ".bmod";
|
||||
|
||||
@@ -169,6 +170,10 @@ export function read_bmod(bytes: Uint8Array, file: string): Bmod {
|
||||
scripts[side as ScriptSide] = code;
|
||||
}
|
||||
}
|
||||
// what the bworld/engine shim reads, so it's in the bundle of every script that imports it
|
||||
if (!manifest.engine_access && Object.values(scripts).some((code) => code.includes(ENGINE_GLOBAL))) {
|
||||
problems.push(`a script uses bworld/engine, which needs "engine_access": true in manifest.json`);
|
||||
}
|
||||
const credits = manifest.credits === undefined ? undefined : text(manifest.credits);
|
||||
if (manifest.credits !== undefined && credits === undefined) {
|
||||
problems.push(`manifest.json: credits ${manifest.credits} isn't in the file`);
|
||||
|
||||
Reference in New Issue
Block a user