Monsters opening doors
This commit is contained in:
@@ -16,7 +16,7 @@ import { LocalPlayer } from "@/client/entity/local_player.ts";
|
||||
import { Options } from "@/client/options.ts";
|
||||
import type { Client } from "@/client/client.ts";
|
||||
import type { ModListing } from "@/common/mod_loader.ts";
|
||||
import { copy_dir, test_game } from "./helpers.ts";
|
||||
import { copy_dir, errors_during, test_game } from "./helpers.ts";
|
||||
import { game_with_pool } from "./chunk_loading.ts";
|
||||
|
||||
const [MAJOR, MINOR] = GAME_VERSION.split(".");
|
||||
@@ -61,19 +61,6 @@ function as_mod<T>(mod: string, fn: () => T, engine_access = true): Promise<T> {
|
||||
return loading_mod(mod, engine_access, () => Promise.resolve(fn()));
|
||||
}
|
||||
|
||||
// what console.error got while fn ran
|
||||
async function errors_during(fn: () => unknown): Promise<string[]> {
|
||||
const errors: string[] = [];
|
||||
const original = console.error;
|
||||
console.error = (...args: unknown[]) => errors.push(args.map(String).join(" "));
|
||||
try {
|
||||
await fn();
|
||||
} finally {
|
||||
console.error = original;
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
Deno.test("a server mod hooks GameServer to drop twice, like the plan's example", async () => {
|
||||
const dir = mods_dir((dir) =>
|
||||
write_mod(
|
||||
|
||||
Reference in New Issue
Block a user