Fill on serverworld and clear out tiles on new day

This commit is contained in:
2026-11-22 11:22:07 -03:00
parent dfb110e0f8
commit c2e885f23a
8 changed files with 64 additions and 18 deletions
+6 -1
View File
@@ -147,8 +147,13 @@ let interior_tiles: PlacedTile[] = [];
// the vents placed in the interior, for monsters to come out of
let interior_vents: Marker[] = [];
// takes away the last interior, so the next one goes in where there's nothing. the surface is placed over itself
function clear_map(ctx: ServerContext) {
// theres no need to clear the surface but we do need to clear each tile
for (const { box: { min: [x0, y0, z0], max: [x1, y1, z1] } } of interior_tiles) {
ctx.world.fill({ x: x0, y: y0, z: z0 }, { x: x1, y: y1, z: z1 }, "cubi:air");
}
interior_tiles = [];
interior_vents = [];
}
function place_surface(ctx: ServerContext) {