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

Rocks multiplying #40978

Closed
Tosscoble opened this issue May 30, 2020 · 10 comments
Closed

Rocks multiplying #40978

Tosscoble opened this issue May 30, 2020 · 10 comments
Labels
<Bug> This needs to be fixed (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@Tosscoble
Copy link

Tosscoble commented May 30, 2020

Describe the bug

The rocks i'm using as ammo for my sling are multiplying. Every rock i pick up count as two on my inventory.

Steps To Reproduce

I couldn't reproduce it, i started a new world, spawned some rocks and a sling, but it worked just fine.

Expected behavior

Every rock i pick should give me one.

Screenshots

rocks

Versions and configuration

  • OS: Windows
    • OS Version: 10.0 1903
  • Game Version: 0.E-2702-ge4d9a10 [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [
    Dark Days Ahead [dda],
    Stats Through Kills [stats_through_kills],
    Magiclysm [magiclysm]
    ]

-->

Additional context

Here is the save

save.zip

@wapcaplet
Copy link
Contributor

I can reproduce the issue using your attached save game - either by dropping 1 rock and picking it up (I get 2 back), or by killing a zombie and getting the rocks back from their corpse (I picked up 3 and got 6 back). I couldn't determine steps to make it happen in a new game world.

@anothersimulacrum anothersimulacrum added (S2 - Confirmed) Bug that's been confirmed to exist <Bug> This needs to be fixed labels May 31, 2020
@EvgenijM86
Copy link
Contributor

EvgenijM86 commented Jun 2, 2020

@KorGgenT what is the intention of this code?

https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/character.cpp#L2309

    } else {
        pocket->add( it );
        ret = &pocket->back();    <---- this line here
    }

Is it supposed to return the item that was added to a pocket? Or just the last item in the pocket?

It calls restack() inside add(), thus, it can return a totally different item than the one we were adding.

In my case pocket->back().display_name(1) returns "pile of straw" when I am trying to pickup wheat on the ground. And it even says in the game log: "You pick up: 1 pile of straw", except I was trying to pickup totally different item.

@Ataman
Copy link

Ataman commented Jun 7, 2020

Not sure #41042 fixed the problem. I keep picking up two arrows instead of one when collecting my fired arrows from the ground.

image

Also interesting, the MP5 was always just sitting in my inventory without being used but the log says I'm picking the MP5 up. (What I'm really picking up are arrows though).

Used version: 0.E-2947-g8c946f2 (tiles), should be build number 10736

@EvgenijM86
Copy link
Contributor

I tested with provided save just now, shot about 30+ rocks, picked them up and the total number of rocks where 46 - same as I started with. So that seems fixed, unless the bug is more rare. Can you upload your own save? It might be specific to your pocket configuration that your character is wearing.

@Ataman
Copy link

Ataman commented Jun 8, 2020

Just made a completely new world with only default mods. I spawned in a short bow and some makeshift wooden arrows as well as the H&K MP5A2 with an extended magazine and finally a daypack.

I spawned in exactly 50 makeshift wooden arrows. After shooting a bit at the ground and 2 zombie dogs, I ended up with: 49 + 5 makeshift wooden arrow and 1 wooden broadhead arrow. Not only did the game produce arrows out of thin air, it even produced one of a different kind...

World save attached.

Alsuma (DEBUG).zip

@EvgenijM86
Copy link
Contributor

I have killed 6 more zombie dogs and could not replicate this. I ended up with 1 less arrow that I started with. Are you sure you have compiled latest code? I.e. git pull on master branch.

@Ataman
Copy link

Ataman commented Jun 8, 2020

I'm not compiling the code myself, I use the CDDA Launcher which, as far as I know, pulls the binaries from the releases section of this github. In this case this one: https://github.com/CleverRaven/Cataclysm-DDA/releases/tag/cdda-jenkins-b10736

@EvgenijM86
Copy link
Contributor

The last commit of that build was at 2020-06-07 20:48:03.
My bugfix was merged in at 2020-06-07 23:47:29.
My conclusion is that your build simply does not have that bugfix.

@Ataman
Copy link

Ataman commented Jun 8, 2020

You're right my bad, I saw that the fix was 6 days old and merged, thus I wrongly assumed the latest release (from that time) had the fix in it.

@int-ua
Copy link
Contributor

int-ua commented Jan 14, 2021

Comments above indicate this was fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

No branches or pull requests

6 participants