Monsters opening doors

This commit is contained in:
2026-11-21 15:16:07 -03:00
parent 2563ec3f69
commit 94463b3cea
6 changed files with 164 additions and 71 deletions
+1 -14
View File
@@ -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(