Repository navigation
Conversation
Container.createLootItem called tmpItem:setText(item.text) when generating monster loot items with configured text. However, Item:setText is not registered in the Atlas Lua API (src/lua/modules/item.cpp), causing a runtime error when dropping written documents or notes. Use the supported Atlas Lua attribute API: tmpItem:setAttribute(ITEM_ATTRIBUTE_TEXT, item.text). Closes atlas-kit#448
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough
ChangesLoot item text
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~5 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The loot text change preserves the existing text-reading and serialization behavior, with no identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
Up to standards ✅🟢 Issues
|
Problem
In
data/lib/core/container.lua,Container.createLootItemcallstmpItem:setText(item.text)when an item dropped as monster loot has configured text:However,
Item:setText()is not registered in the Atlas Lua API (src/lua/modules/item.cpp). When a monster drop contains an item with text (such as readable notes or quest/lore documents),createLootItemfails with a runtime error attempting to call methodsetText(a nil value).Fix
Replace the invalid
tmpItem:setText(item.text)call with the supported Atlas Lua attribute method:No new C++ bindings are introduced, and all existing loot logic (actionId, chance, subtype, and child loot behavior) is preserved.
Validation
data/lib/core/container.luausing AST parser.ctest).git diff --check.data/lib/core/container.lua.Closes #448
Summary by CodeRabbit