Skip to content

Fix storage unit naming#27

Merged
GT-610 merged 2 commits into
mainfrom
fix/issue-23-storage-unit-naming
Jul 16, 2026
Merged

Fix storage unit naming#27
GT-610 merged 2 commits into
mainfrom
fix/issue-23-storage-unit-naming

Conversation

@GT-610

@GT-610 GT-610 commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Resolve #23.

Summary by CodeRabbit

  • New Features

    • Added support for naming eligible caskets without requiring a name-tag item.
    • Caskets are automatically prepared with the necessary metadata when named.
  • Bug Fixes

    • Prevented unnecessary destroy messages when no item type is specified.
    • Improved validation for name tags and nameable items.
    • Ensured name-tag items are consumed only when actually used.

Handle the client's zero-id built-in casket naming path, initialize storage metadata, and avoid sending empty tool removal messages.
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@GT-610, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cb83af4e-fa74-4287-a4bd-06c11ff77055

📥 Commits

Reviewing files that changed from the base of the PR and between a43c202 and 4cfd9c2.

📒 Files selected for processing (2)
  • csgo_gc/gc_client.cpp
  • csgo_gc/inventory.cpp
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address issue #23 by fixing casket naming flow, initializing storage metadata, and avoiding invalid destroy messages.
Out of Scope Changes check ✅ Passed The diff stays focused on the naming bug fix and does not show unrelated or clearly extraneous changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and broadly matches the PR’s focus on fixing naming behavior around storage units and caskets.

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.

@GT-610
GT-610 changed the base branch from master to main July 16, 2026 09:25
@GT-610
GT-610 marked this pull request as ready for review July 16, 2026 09:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
csgo_gc/gc_client.cpp (1)

1727-1729: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Conditionally dispatch the destroy update in NameBaseItem.

Similar to the fix applied above in NameItem, this function unconditionally sends the k_ESOMsg_Destroy message. Since Inventory::NameBaseItem only populates the destroy object when GetConfig().DestroyUsedItems() is true, the destroy object can remain empty here.

Wrap the dispatch in a type-id check to prevent sending empty tool-removal messages. As per the relevant code snippets, ServerGC runs ValidateMessageOwnerSOID for k_ESOMsg_Destroy messages, which will fail if the object is empty.

🐛 Proposed fix
         SendMessageToGame(true, k_ESOMsg_Create, create);
-        SendMessageToGame(true, k_ESOMsg_Destroy, destroy);
+        if (destroy.has_type_id())
+        {
+            SendMessageToGame(true, k_ESOMsg_Destroy, destroy);
+        }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@csgo_gc/gc_client.cpp` around lines 1727 - 1729, Update
Inventory::NameBaseItem so k_ESOMsg_Destroy is dispatched only when the destroy
object has a valid type ID, while continuing to send k_ESOMsg_Create
unconditionally. Use the destroy object's existing type-id accessor/check to
avoid sending an empty removal message.
🧹 Nitpick comments (1)
csgo_gc/inventory.cpp (1)

1227-1230: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Avoid redundant attribute search.

Since FindOrAddAttribute internally calls FindAttribute as its first step, calling it right after !FindAttribute(...) results in a redundant linear scan. You can directly add the attribute here to skip the second search.

♻️ Proposed refactor
-        CSOEconItemAttribute *countAttribute =
-            FindOrAddAttribute(casket, ItemSchema::AttributeCasketItemsCount);
+        CSOEconItemAttribute *countAttribute = casket.add_attribute();
+        countAttribute->set_def_index(ItemSchema::AttributeCasketItemsCount);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@csgo_gc/inventory.cpp` around lines 1227 - 1230, Update the casket attribute
handling around AttributeCasketItemsCount to avoid calling FindOrAddAttribute
immediately after FindAttribute has confirmed the attribute is absent. Directly
create or add the count attribute in that branch, preserving the existing
initialization and behavior without performing a second linear search.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@csgo_gc/gc_client.cpp`:
- Around line 1727-1729: Update Inventory::NameBaseItem so k_ESOMsg_Destroy is
dispatched only when the destroy object has a valid type ID, while continuing to
send k_ESOMsg_Create unconditionally. Use the destroy object's existing type-id
accessor/check to avoid sending an empty removal message.

---

Nitpick comments:
In `@csgo_gc/inventory.cpp`:
- Around line 1227-1230: Update the casket attribute handling around
AttributeCasketItemsCount to avoid calling FindOrAddAttribute immediately after
FindAttribute has confirmed the attribute is absent. Directly create or add the
count attribute in that branch, preserving the existing initialization and
behavior without performing a second linear search.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3fe2e9a7-0b96-42ac-aa27-b9f30d66899b

📥 Commits

Reviewing files that changed from the base of the PR and between 89ec451 and a43c202.

📒 Files selected for processing (2)
  • csgo_gc/gc_client.cpp
  • csgo_gc/inventory.cpp

@GT-610 GT-610 changed the title Fix storage unit naming throughout GC and launcher code Fix storage unit naming Jul 16, 2026
Avoid dispatching empty base-item removal messages and eliminate a redundant casket attribute lookup.
@GT-610
GT-610 merged commit 6ac3664 into main Jul 16, 2026
5 checks passed
@GT-610
GT-610 deleted the fix/issue-23-storage-unit-naming branch July 16, 2026 09:39
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.

Storage units not working

1 participant