Repository navigation
fix: Repair the XP rate cap and SQL install step - #49
Conversation
The README told users to import the SQL by hand or with db_assembler.sh, which no longer exists. The module ships its SQL in data/sql/db-world/ and the worldserver's DB updater applies it to the world database at startup when world DB updates are enabled (Updates.EnableDatabases), so describe that instead. Closes azerothcore#9 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rate cap added in azerothcore#41 wrote the capped rate back as an integer instead of copying the float's bits. Later reads decoded it as ~0, so affected players gained no XP at all during the event, not just no bonus, while the login text announced the bonus. The cap now stores the rate with the bit encoding. Stored rates that are not a normal positive float, such as those written by the old cap, fall back to XPWeekend.xpAmount (capped to MaxAllowedRate) and are rewritten, so affected characters recover on their own. Closes azerothcore#9 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Self-review — fix-weekend-xp-rate-cap → masterOutcome 2 findings — 1 fixed (commit message), 1 dismissed — single round, no code blockers Fixes not re-reviewed finding 1: the reworded commit body, applied by amend in Reviewed By Claude Code, claude-opus-5-5 — self-review v0.14, 2026-10-16 Testing compiled and tested in-game by the author (2026-10-17, level-1 character vs level-1 mobs, base 50 XP, Review details (1 round)Intent Fix mod-weekend-xp #9: the README's SQL install step is out of date (the module SQL is auto-applied by the worldserver DB updater, Project rules Diff Metadata The module repo has no planning home, so this report lives in the core repo's Round 1 —
|
|
CC @Helias |
What and why
Closes #9, which has two parts.
The README still told admins to import the SQL by hand or with
db_assembler.sh, which AzerothCore doesn't have anymore. The module has shipped its SQL indata/sql/db-world/since #11, and the worldserver applies it at startup, so the install steps now say that.Players being told about the bonus without getting it has a real cause in today's code. With
XPWeekend.IndividualXPEnabled = 1, the rate cap added in #41 saved the capped rate as a plain integer instead of the float bits the module reads back. The next read turned2into about2.8e-45, so XP was multiplied down to 0 and the player gained no XP at all while the login text still announced the bonus.Decisions worth knowing
PlayerSettingSetRate, so the stored setting still matches the applied rate, which is what Sync player setting when capping XP rate #41 wanted.XPWeekend.xpAmount, capped atMaxAllowedRate, and gets saved again, so characters already broken by the old cap recover on their own with no DB edit. That's the same rate a player who never used.weekendxp rategets.1), and the player can set the rate again with.weekendxp rate.Review guide
src/mod-double-xp-weekend.cpp, theConfigIndividualXPEnabled()block inGetExperienceRate. The login text,.weekendxp configand the XP hook all go through it.std::isnormalcatches every value the old cap could have written, since any integer below0x00800000reads back as zero or a subnormal float.README.mdis mechanical.Known gaps
EnablePlayerSettings = 0. The changed path only touches the in-memory setting there, and the rate is seeded again at every login like before.