Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unpack the "Opened case" item will throw exception #996

Open
dounai2333 opened this issue Dec 25, 2024 · 1 comment
Open

Unpack the "Opened case" item will throw exception #996

dounai2333 opened this issue Dec 25, 2024 · 1 comment
Labels
bug Something isn't working fixed

Comments

@dounai2333
Copy link

dounai2333 commented Dec 25, 2024

SPT Version

3.10

Project Type

Server

Expected Result

Got reward with several "Sealed box" items and one "Contraband box" item.

Actual Result

Server throw a exception and cause client softlock.

Steps To Reproduce

  1. Get "Opened case" item (tpl: 674078c4a9c9adf0450d59f9)
  2. Unpack
  3. Exception happens

Server Log

TypeError: Cannot read properties of undefined (reading 'item')
TypeError: Cannot read properties of undefined (reading 'item')
    at WeightedRandomHelper.getWeightedValue (C:\snapshot\src\helpers\WeightedRandomHelper.ts:16:27)
    at LootGenerator.pickRewardItem (C:\snapshot\src\generators\LootGenerator.ts:627:46)
    at LootGenerator.getRandomLootContainerLoot (C:\snapshot\src\generators\LootGenerator.ts:599:46)
    at InventoryController.openRandomLootContainer (C:\snapshot\src\controllers\InventoryController.ts:825:52)
    at InventoryCallbacks.openRandomLootContainer (C:\snapshot\src\callbacks\InventoryCallbacks.ts:201:34)
    at InventoryItemEventRouter.handleItemEvent (C:\snapshot\src\routers\item_events\InventoryItemEventRouter.ts:89:48)
    at ItemEventRouter.handleEvents (C:\snapshot\src\routers\ItemEventRouter.ts:36:35)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at ItemEventCallbacks.handleEvents (C:\snapshot\src\callbacks\ItemEventCallbacks.ts:22:31)

BepinEx Log

None

Client Log

None

Player Profile

No response

Screenshots

In commit 3662767, "Opened case" has been added and have rewards, however the "Opened case" item use the wrong value:

"rewardTplPool": ["67409848d0b2f8eb9b034db9"]

Fixes:

            "rewardTplPool": {
                "67409848d0b2f8eb9b034db9": 5,
                "67408903268737ef6908d432": 2
            }
@dounai2333 dounai2333 added the triage New issue. Who dis? label Dec 25, 2024
@chompDev
Copy link
Contributor

Fixed with: c6a9a1a

@chompDev chompDev added bug Something isn't working fixed and removed triage New issue. Who dis? labels Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

2 participants