namespace AcDream.Core.Meshing; /// /// Should a hydrated stab/entity survive when its visual mesh flattens to /// zero drawable parts? /// /// /// Why this exists (#79/#93, 2026-07-09). A dat-authored "light attach /// point" is a Setup whose sole purpose is to carry a Setup.Lights /// entry — its own visual part is commonly a #136-class runtime-hidden /// marker (degrades to nothing at any real distance, matching retail's /// editor-only placement markers). Retail's light registration /// (CObjCell::add_light, populated at CEnvCell::UnPack) is /// entirely independent of a fixture's own mesh visibility — a mesh-less /// carrier still lights the room. The Town Network fountain room's only /// light (Setup 0x02000365, a ceiling fixture 5 m above the fountain) never /// registered because the mesh-empty gate treated "nothing to draw" as /// "nothing exists," dropping the entity — and its Lights — before the /// light-registration pass ever saw it. /// /// public static class EntityHydrationRules { /// /// True when the entity should still be added to the landblock's entity /// set even with zero mesh refs, because it has dat-authored lights to /// register. An entity with any mesh is always kept (unchanged from the /// pre-existing gate); the entity is dropped only when it has neither /// geometry to draw nor lights to register. /// public static bool ShouldKeepEntity(int meshRefCount, int setupLightCount) => meshRefCount > 0 || setupLightCount > 0; }