Skip to content

Guard against SLOT_AUGMENT_GENERIC_RETURN in evolving item toggle and transfer#101

Merged
Valorith merged 2 commits intocodex/evolving-item-review-fixes-masterfrom
copilot/sub-pr-98
Mar 22, 2026
Merged

Guard against SLOT_AUGMENT_GENERIC_RETURN in evolving item toggle and transfer#101
Valorith merged 2 commits intocodex/evolving-item-review-fixes-masterfrom
copilot/sub-pr-98

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 22, 2026

HasEvolvingItem returns invslot::SLOT_AUGMENT_GENERIC_RETURN (1001) when the evolving unique ID is found on an augment rather than a standalone item. Passing that sentinel to GetItem always 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::HasEvolvingItem can return invslot::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 to GetItem(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: Explicit SLOT_AUGMENT_GENERIC_RETURN guard 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-facing Chat::Red message and log entry explaining augment-based evolving items are not supported for XP transfer.
if (slot_id == EQ::invslot::SLOT_AUGMENT_GENERIC_RETURN) {
    LogEvolveItem(
        "Character ID <green>[{}] toggle evolve item unique id <yellow>[{}] is an augment-based evolving item; "
        "augment-based evolving items are not supported for toggling",
        CharacterID(),
        in->unique_id
    );
    return;
}

Type of change

  • Bug fix (non-breaking change which fixes an issue)

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

  • I have tested my changes
  • I have performed a self-review of my code. Ensuring variables, functions and methods are named in a human-readable way, comments are added only where naming of variables, functions and methods can't give enough context.
  • I own the changes of my code and take responsibility for the potential issues that occur

⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copilot AI mentioned this pull request Mar 22, 2026
@Valorith Valorith changed the title [WIP] [WIP] Address feedback on 'Evolving Item Fixes' PR Address feedback on 'Evolving Item Fixes' PR Mar 22, 2026
… 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 AI changed the title Address feedback on 'Evolving Item Fixes' PR Guard against SLOT_AUGMENT_GENERIC_RETURN in evolving item toggle and transfer Mar 22, 2026
Copilot AI requested a review from Valorith March 22, 2026 16:40
@Valorith Valorith marked this pull request as ready for review March 22, 2026 16:41
@Valorith
Copy link
Copy Markdown
Owner

@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.

Copy link
Copy Markdown
Author

Copilot AI commented Mar 22, 2026

@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 u...

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 HasEvolvingItem), it returns a slot number so the code can fetch the item instance. However, when the evolving ID is found on an augment (socketed inside another item), there's no real slot number to return — augments live inside parent items, not in their own inventory slots. The function signals this by returning a special sentinel value (SLOT_AUGMENT_GENERIC_RETURN = 1001) instead of a real slot.

The bug: the old code would then call GetItem(1001), get back null (since 1001 isn't a real slot), and silently do nothing — the toggle would appear to go through but have no effect, and no error was logged.

The fix: Before calling GetItem, we now check whether the slot is the augment sentinel. If it is, we bail out early with a log message explaining why. No crash, no silent failure — just a clear "this isn't supported for augment-based evolving items" diagnostic.

To directly answer your questions:

  • Items with augments socketed into them — totally fine. Those items live in real inventory slots and the code handles them correctly. This bug doesn't affect them at all.
  • Evolving item XP gain (ProcessEvolvingItem) — also unaffected. That function iterates over worn items directly, not via HasEvolvingItem, so it was never broken.

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.

@Valorith Valorith merged commit 57a7849 into codex/evolving-item-review-fixes-master Mar 22, 2026
1 check passed
@Valorith Valorith deleted the copilot/sub-pr-98 branch March 22, 2026 16:46
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.

2 participants