Skip to content

Client polish & latent fixes #428

Description

@marceld23

A bundle of five small, self-contained client fixes — each is a one-to-few-line change with a clear file/line pointer. Ideal as a first contribution; the items are independent and can be done in any order (or split up).

  • N10 — placed-lamp light stops dead at world wrap seams. Light sources are stored in canonical coordinates, but LightSourcesNear's box filter and the flood-fill keys use raw un-wrapped integers (ClientWorld.cs:193, ChunkMesher.cs:1234). A lamp placed within ~4 blocks of the X=0/circumference (or latitude) seam is filtered out entirely, and flood light can never cross the seam — every other cross-seam system (skylight, AO, culling) canonicalizes; block light is the one that doesn't. Fix: filter with WrapDeltaX/Z and re-express sources in the chunk's raw frame before seeding the flood.
  • N11 — missing-locale-key guard never fires. Localizer.Get returns "[key]" for unknown keys, but the guard compares the result against the bare key (UiMainMenu.cs:339; same latent pattern in CraftingTechShipUI.cs:3259), so it can never match. A portal error code unknown to this build shows the literal [ui.portal.err_x] instead of the intended readable fallback. Fix: compare against "[" + key + "]" or use Localizer.Has (as WikiUI already does).
  • N12 — WikiUI article-load failure is completely unlogged. The catch block silently swaps in an empty article list (WikiUI.cs:303) — a corrupt articles.json removes every hand-written wiki article without a trace, while the otherwise-identical minigame-catalog loader does warn. Fix: one Debug.LogWarning in the catch.
  • N15 — BuildScript shader safety net covers only 12 of ~18 runtime Shader.Find shaders. The EnsureShadersIncluded guard (Editor/BuildScript.cs:36) re-adds only 12 names; BlockAtlasTransparent, ScatterLit, HeatHaze, SkyBodyPhase, Starfield, Visor, VisorGlass are missing. Nothing is broken today, but if GraphicsSettings.asset ever regresses (merge conflict, Unity rewrite), those shaders strip silently and the build succeeds with no glass/energy-field submesh, no starfield and a flat HUD. Fix: extend RuntimeShaders to the full set (and drop the one dead GUID in the list).
  • N16 — Built-in-RP subshader misroutes bark tint into the dye branch. The second (Built-in RP) SubShader lacks the > 3.5 bark branch the URP pass has (Shaders/BlockAtlas.shader:416), so wood_log faces would get the player-dye recolor math. Dormant while URP is active in all builds; only bites on a URP-asset load failure/fallback. Fix: mirror the bark branch — or delete the retired Built-in subshader.

All five were found in a static code audit of the client (internal finding IDs N10, N11, N12, N15, N16).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: clientUnity client / Client.CoreauditSurfaced by the static bug-hunt audit (bugreports/bughunt.md)bugSomething isn't workinggood first issueGood for newcomerspriority: lowCosmetic / latent / dormant hardening

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions