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

Dice are consumed on activation #5789

Closed
ZChris13 opened this issue Dec 4, 2024 · 5 comments · Fixed by #5793
Closed

Dice are consumed on activation #5789

ZChris13 opened this issue Dec 4, 2024 · 5 comments · Fixed by #5793
Labels

Comments

@ZChris13
Copy link

ZChris13 commented Dec 4, 2024

Describe the bug

One of the recent changes to using items has caused dice to consume themselves upon use

Steps To Reproduce

obtain any RPG die, activate it to roll it
observe that it has disappeared
if you have multiple, observe that it will consume the entire stack as many as the number it rolled

Screenshots

image

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19045.5131 (22H2)
  • Game Version: 08833c3 [64-bit]
  • Graphics Version: Tiles
  • LAPI Version: 2
  • Game Language: []
  • Mods loaded: [
    Bright Nights [bn],
    Disable NPC Needs [no_npc_food],
    Simplified Nutrition [novitamins],
    No Rail Stations [No_Rail_Stations],
    Limit Fungal Growth [limit_fungal_growth],
    Teleportation [teleportation_tech],
    Craftable Gun Pack [craftgp]
    ]

Additional context

I collect dice :)
image
I am very sad that my stack of seven 20 sided metal dice were consumed :(

@ZChris13 ZChris13 added the bug label Dec 4, 2024
@ZChris13 ZChris13 changed the title Dice are currently consumed on use Dice are consumed on activation Dec 4, 2024
@scarf005
Copy link
Member

scarf005 commented Dec 4, 2024

cc @KheirFerrum

@KheirFerrum
Copy link
Collaborator

This is a known bug we inherited. I have no idea why the fuck the iuse was coded the way it was. The iuse should instead return 0 instead if the roll value. I may throw a PR together later today if no one else does. It's basically a single line change.

@ZChris13
Copy link
Author

ZChris13 commented Dec 5, 2024

this is new, BRB checking which release it happened in

@ZChris13
Copy link
Author

ZChris13 commented Dec 5, 2024

release 6bbf3ad (2024-10-17) does not have the bug
release 88c3a84 (2024-10-19) does have the bug

I guess you knew that it was your PR #5589 that was causing this?

@KheirFerrum
Copy link
Collaborator

KheirFerrum commented Dec 5, 2024

release 6bbf3ad (2024-10-17) does not have the bug release 88c3a84 (2024-10-19) does have the bug

I guess you knew that it was your PR #5589 that was causing this?

Lol, interesting, had an inkling, but no, I did not. I came across this bug while I was refactoring #5259. Looks like fixing one bug exposed another. The issue here is that iuse action is supposed to return charges to use, this was masked by a separate bug that was causing the returned value to not be used up.

A fix will be up in a short bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants