Guard against SLOT_AUGMENT_GENERIC_RETURN in evolving item toggle and transfer#101
Conversation
… transfer functions Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com> Agent-Logs-Url: https://github.com/Valorith/Server/sessions/889294cb-cd6a-4b98-afce-7d63d7a6cd9f
|
@copilot Explain this issue/fix in simple terms for me. Does this mean that items with augments in them cannot be flagged as evolving items or cannot gain evolving item xp? Help me understand. |
Great question — it's a subtle edge case. Let me break it down: The scenario this affects: An augment itself being flagged as an evolving item — not a normal item that happens to have augments socketed into it. That's an unusual configuration but technically possible in the data. What was going wrong: When the server searches a player's inventory for an evolving item by unique ID (via The bug: the old code would then call The fix: Before calling To directly answer your questions:
The only things that were broken (and are now gracefully rejected) are the toggle (enable/disable evolving) and XP transfer features when the augment itself is the evolving item. |
57a7849
into
codex/evolving-item-review-fixes-master
HasEvolvingItemreturnsinvslot::SLOT_AUGMENT_GENERIC_RETURN(1001) when the evolving unique ID is found on an augment rather than a standalone item. Passing that sentinel toGetItemalways returns null, silently dropping toggle and transfer operations for augment-hosted evolving items.Note: this only affects the edge case where the augment itself is tagged as an evolving item. Normal items that have augments socketed into them, and regular evolving item XP gain, are unaffected.
Description
InventoryProfile::HasEvolvingItemcan returninvslot::SLOT_AUGMENT_GENERIC_RETURN(1001) when the evolving unique ID is found on an augment slotted inside a parent item. This value is not a real inventory slot, so any subsequent call toGetItem(slot_id)returns null. Previously, the toggle and XP transfer functions would silently fail in this scenario — no error was logged, no message was shown to the player, and the operation was dropped without explanation.This fix explicitly detects the augment sentinel return value and rejects the operation with a clear log entry (and a user-facing message where appropriate), rather than allowing it to silently null-deref.
Changes
DoEvolveItemToggle: ExplicitSLOT_AUGMENT_GENERIC_RETURNguard with log entry — augment-based evolving items are not supported for toggling.SendEvolveXPWindowDetails: Same guard, silent early return (preview window, no user action committed).DoEvolveTransferXP: Same guard with user-facingChat::Redmessage and log entry explaining augment-based evolving items are not supported for XP transfer.Type of change
Testing
Validated logic by code review; augment-based evolving items now produce clear diagnostic output instead of a silent null-deref failure path. Normal items with augments socketed into them and regular evolving item XP gain (
ProcessEvolvingItem) are unaffected by this change.Clients tested: N/A (server-side logic only)
Checklist
⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.