From 05ea321d9e0df1fc7aa2544f29f3ba112f48626c Mon Sep 17 00:00:00 2001 From: Houmgaor Date: Mon, 6 Apr 2026 17:10:33 +0200 Subject: [PATCH] fix(migrations): heal rasta_id=0 rows (#163) The pre-106cf85 SaveMercenary bug could overwrite a character's NULL rasta_id with 0, a value not drawn from rasta_id_seq that causes silent save failures. The code fix prevents new occurrences but leaves already affected rows stuck. Migration 0010 sets rasta_id=NULL where it is 0 so existing users auto-heal on upgrade. --- CHANGELOG.md | 1 + server/migrations/sql/0010_fix_zero_rasta_id.sql | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 server/migrations/sql/0010_fix_zero_rasta_id.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index d578c4bcb..0333e1e5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Added migration `0010_fix_zero_rasta_id` to heal characters whose `rasta_id` was clobbered to `0` by the pre-fix `SaveMercenary` bug ([#163](https://github.com/Mezeporta/Erupe/issues/163)). Sets `rasta_id = NULL` for affected rows so silent save failures auto-resolve on upgrade. - Fixed quest tune-value filter silently dropping user-configured multipliers set to `0.0`: previously setting e.g. `ZennyMultiplier: 0.0` would strip the entry from the table and fall back to the client's default (100%), producing the opposite of the intended "no zenny" configuration. The `Value > 0` filter in `handleMsgMhfEnumerateQuest` has been removed so zero values are now sent verbatim. Affects HRP/SRP/GRP/GSRP/Zenny/GZenny/Material/GMaterial/GCP/GUrgent multipliers and their NC variants. - Fixed float32 truncation in quest multiplier conversion: `uint16(0.20 * 100)` yielded `19` instead of `20` because `float32(0.20) ≈ 0.19999998`. Replaced with a `multiplierToTuneValue` helper that rounds via `math.Round`. Applied to all 18 multiplier call sites. - Fixed `DisableLoginBoost` and `DisableBoostTime` config flags not fully honored ([#187](https://github.com/Mezeporta/Erupe/issues/187)): `GetBoostTimeLimit`/`GetBoostRight` now respect `DisableBoostTime` and `UseKeepLoginBoost` now respects `DisableLoginBoost`. Also fixes a zero-`time.Time` wraparound in `GetBoostTimeLimit` that made the "Boost Time" overlay appear on fresh characters. diff --git a/server/migrations/sql/0010_fix_zero_rasta_id.sql b/server/migrations/sql/0010_fix_zero_rasta_id.sql new file mode 100644 index 000000000..a14bad12a --- /dev/null +++ b/server/migrations/sql/0010_fix_zero_rasta_id.sql @@ -0,0 +1,5 @@ +-- Heal characters whose rasta_id was clobbered to 0 by the pre-106cf85 +-- SaveMercenary bug. A rasta_id of 0 is not a valid sequence value and +-- causes silent save failures on affected characters (see #163). +-- The normal default for characters that never registered a mercenary is NULL. +UPDATE public.characters SET rasta_id = NULL WHERE rasta_id = 0;