Skip to content

[World] Restore weekly currency cap reset wiring#297

Merged
billy1arm merged 2 commits into
mangosthree:masterfrom
r-log:fix/saved-variables-currency-reset
Jul 4, 2026
Merged

[World] Restore weekly currency cap reset wiring#297
billy1arm merged 2 commits into
mangosthree:masterfrom
r-log:fix/saved-variables-currency-reset

Conversation

@r-log

@r-log r-log commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Cata's weekly currency-cap reset is dead. saved_variables has no NextCurrenciesResetTime column, and World::InitCurrencyResetTime() / World::ResetCurrencyWeekCounts() have no callers — commit 165cfba9c (2016) removed the wiring (it reverted 8e5d609e1, which had replaced WotLK arena-point distribution with the currency reset). Result: character_currencies.weekCount never resets, so the weekly Conquest cap silently becomes a permanent lifetime cap — a player who caps in week 1 can never earn Conquest again. Arena-team weekly stats never reset either.

Restores the wiring: InitCurrencyResetTime() in SetInitialWorldSettings and the if (m_gameTime > m_NextCurrencyReset) { ResetCurrencyWeekCounts(); } trigger in World::Update (next to the daily/weekly/monthly resets). The reset function, config keys (Currency.Reset*), and per-player CurrencyMgr::ResetWeekCounts all already exist.

Schema coordination: needs a paired mangosthree/database migration Rel22_03_004_Add_NextCurrenciesResetTime (adds the bigint column); this PR bumps CHAR_DB_CONTENT_NR to 4. It sequences after #296 (the cleaner, Rel22_03_003 / content 3) — the two are a schema pair. If you'd rather land this one first/alone, the content number and migration should be renumbered to 3 / Rel22_03_003. Migration SQL is ready.


This change is Reviewable

InitCurrencyResetTime() and ResetCurrencyWeekCounts() have been
orphaned since 165cfba reverted World.cpp to the previous core:
the init call and the World::Update trigger were dropped, so
character_currencies.weekCount was never reset and the shipped
Currency.Reset* config options were dead. Re-wire both call sites
as originally added in 8e5d609.

Requires char DB update Rel22_03_004 which adds the
saved_variables.NextCurrenciesResetTime column these functions
persist to (content-level bump, older DBs still boot with a
warning).
billy1arm pushed a commit to mangosthree/database that referenced this pull request Jul 4, 2026
#132)

Paired with mangosthree/server#297 (weekly currency cap reset). Chains db_version 22/03/003 -> 22/03/004, so it sequences after Rel22_03_003 (#296); if landing alone, renumber to 003.
@billy1arm billy1arm merged commit 8689fd0 into mangosthree:master Jul 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants