From 30ee904840f9591ebfd8ceaf5a5bab583069f753 Mon Sep 17 00:00:00 2001 From: Samuel Lison Date: Fri, 19 Jun 2026 15:15:46 +1000 Subject: [PATCH] Make stat fill-direction engine-owned (fix afflictions still filling wrong) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `invert` and `dangerHigh` are stat semantics, not owner tuning — but they were in the SurvivalStatsConfig instance's override map, so a stale/place-saved instance (carrying the old Invert=true) overrode the corrected engine default and kept Poison/Hunger/Thirst filling the wrong way. Removed both from STUDIO_ATTR_MAP and stopped shipping them on the config template, so the engine always owns them and a stale instance can never freeze a bug across an update. Per-bar `Invert` attribute remains for a deliberate one-off display flip. Co-Authored-By: Claude Opus 4.8 --- assets/config/SurvivalStatsConfig.model.json | 14 -------------- src/stats/StatConfig.luau | 9 ++++++--- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/assets/config/SurvivalStatsConfig.model.json b/assets/config/SurvivalStatsConfig.model.json index 776dcda..52637fe 100644 --- a/assets/config/SurvivalStatsConfig.model.json +++ b/assets/config/SurvivalStatsConfig.model.json @@ -9,8 +9,6 @@ "Max": 100, "Start": 100, "WarnAt": 25, - "DangerHigh": false, - "Invert": false, "Display": true, "Icon": "", "ValueFormat": "fraction" @@ -24,8 +22,6 @@ "Max": 100, "Start": 100, "WarnAt": 25, - "DangerHigh": false, - "Invert": false, "Display": true, "Icon": "", "ValueFormat": "fraction" @@ -39,8 +35,6 @@ "Max": 100, "Start": 0, "WarnAt": 25, - "DangerHigh": true, - "Invert": false, "Display": true, "Icon": "", "ValueFormat": "fraction" @@ -54,8 +48,6 @@ "Max": 100, "Start": 0, "WarnAt": 25, - "DangerHigh": true, - "Invert": false, "Display": true, "Icon": "", "ValueFormat": "fraction" @@ -69,8 +61,6 @@ "Max": 100, "Start": 0, "WarnAt": 25, - "DangerHigh": true, - "Invert": false, "Display": true, "Icon": "", "ValueFormat": "fraction" @@ -84,8 +74,6 @@ "Max": 100, "Start": 0, "WarnAt": 25, - "DangerHigh": true, - "Invert": false, "Display": true, "Icon": "", "ValueFormat": "fraction" @@ -99,8 +87,6 @@ "Max": 100, "Start": 100, "WarnAt": 25, - "DangerHigh": false, - "Invert": false, "Display": true, "Icon": "", "ValueFormat": "fraction" diff --git a/src/stats/StatConfig.luau b/src/stats/StatConfig.luau index 7989fa7..e5a8b05 100644 --- a/src/stats/StatConfig.luau +++ b/src/stats/StatConfig.luau @@ -21,14 +21,17 @@ local StatConfig = {} StatConfig.CONFIG_SECTION = "SurvivalStats" StatConfig.CONFIG_INSTANCE_NAME = "SurvivalStatsConfig" --- Attribute name on the Studio Configuration child -> resolved field name. +-- Attribute name on the Studio Configuration child -> resolved field name. Only OWNER-tunable +-- knobs live here. Stat *semantics* — `invert` (fill direction) and `dangerHigh` (which end is +-- bad) — are engine-owned and deliberately NOT overridable from the instance, so a stale or +-- place-saved instance can never freeze them to a wrong value across an engine update (the bug +-- where Poison/Hunger filled the wrong way). For a one-off display flip, set the per-bar +-- `Invert` attribute on the HUD bar itself instead. local STUDIO_ATTR_MAP = { RatePerSecond = "ratePerSecond", Max = "max", Start = "start", WarnAt = "warnAt", - Invert = "invert", - DangerHigh = "dangerHigh", Display = "display", Icon = "icon", ValueFormat = "valueFormat",