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
+13
View File
@@ -465,3 +465,16 @@ export function test_mob(game: GameServer, fields: Partial<EntityJson>, x: numbe
game.entities.add_entity(mob);
return mob;
}
// what console.error got while fn ran
export 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;
}