Skip to content

fix(player): display gained experience as integer - #451

Open
hexbranch wants to merge 1 commit into
atlas-kit:devfrom
hexbranch:fix/player-experience-display
Open

hexbranch wants to merge 1 commit into
atlas-kit:devfrom
hexbranch:fix/player-experience-display

Conversation

@hexbranch

@hexbranch hexbranch commented Oct 6, 2026 •

Copy link
Copy Markdown

Experience modifiers can produce fractional Lua values before the result is converted back to uint64_t in C++.

The gain message currently concatenates the raw Lua value, which can display values such as 25.897959183673 experience points.

Floor the displayed value to match the integer experience actually credited to the player.

No experience calculation behavior is changed.

Summary by CodeRabbit

  • Bug Fixes
    • Experience messages now display whole-number amounts while preserving the original experience value.

@hexbranch
hexbranch force-pushed the fix/player-experience-display branch from fe64f83 to db1de73 Compare October 6, 2026 12:20
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ab960170-315c-4b4e-a6ac-6694afdf991f
📥 Commits

Reviewing files that changed from the base of the PR and between 09fe456 and db1de73.

📒 Files selected for processing (1)
  • data/scripts/events/player/default_onGainExperience.lua

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The experience message now displays and sends the floored experience amount. The callback still returns the original experience value.

Changes

Experience Message Display

Layer / File(s) Summary
Floor the message experience amount
data/scripts/events/player/default_onGainExperience.lua
The callback uses floor(exp) for the displayed amount and numeric message value. It returns the original exp.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to db1de

The notification now shows an integer while experience credit remains unchanged. The inspected shipped modifiers preserve the same credited integer amount, with no new merge-blocking risk identified.

Architecture Summary

Architecture risk: 🔵 Low · up to db1de

The change affects 1 system.

Changed systems: data

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — data (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in data/scripts/events/player/default_onGainExperience.lua: The message uses floor(exp) for both the displayed experience text and the numeric message value; previously both used the unrounded exp.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: display gained experience as an integer.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant