Grantapher / ValheimPlus

A HarmonyX Mod aimed at improving the gameplay and quality of life of the game Valheim.
GNU Affero General Public License v3.0
221 stars 24 forks source link

[BUG] Beehive auto-deposit clears chest #10

Open Grantapher opened 1 year ago

Grantapher commented 1 year ago

Describe the bug

From discord:

Getting a bug where the auto place for the beehives changes the chest it places the honey in and deletes everything in the chest. Anyone else had this happen? I ended up removing all my beehives after losing hours of plains materials

...basically I had 5 beehives lined up on the side of a two story base. Maybe 5m. They started being placed in a central chest inside my base about 7 meters from the center beehive. When it would auto place, it would delete the contents of the chest, including previously placed honey. I added a new chest outside my base between the beehives and existing chests. At some point it went to a different previously placed chest and deleted all items in there. These are all reinforced chests.

I did delete the original chest after I placed the one outside, which could partially explain it being placed in a new chest inside, but the deletion of all items is really what concerned me.

From @Grantapher:

I believe every time it tries to deposit to chest it will check all the existing chests without regard to where it deposited it before.

I'll have to test it out myself for sure. My suspicion is that this may be due to multiple beehive deposits being done at the same time, so a (annoying) workaround for now could be to have one chest per beehive.

Could also be a more obvious bug in the code but I won't get a chance to peek at it for a while.

Grantapher commented 1 year ago

I had the same thing happen (albeit before this most recent update) except it only nuked a chest full of leather scraps. Same thing happened, when the beehives all dumped, they overloaded the prior chest and dumped into a new one, and nuked all the leather therein.

Accelerator900 commented 1 year ago

Heya Grantapher - just thought I'd let you know this bug has been around since about a year ago~ We had the same issue on a server I used to play for (I now mod/admin for it) Let me know if you need any help testing or something~ P.S. It's Winter~

stelucz commented 11 months ago

Confirming it. It was depositing honey to nearest chest for ~150 in-game days and just now it picked random reinforced chest and all content of chest disappeared (veggies).

Grantapher commented 9 months ago

Hey any folks affected by this, are you using the PlantEverything mod with the bulk harvest feature enabled?

There is more discussion about this in the discord in this post.

stelucz commented 9 months ago

Hey any folks affected by this, are you using the PlantEverything mod with the bulk harvest feature enabled?

There is more discussion about this in the discord in this post.

Hi, no. I have MassFarming installed together with V+.

Grantapher commented 9 months ago

That mod has the same effect for the purpose of this bug, thanks for letting me know!

AdvizeGH commented 6 months ago

Has this yet to be resolved? Is it only beehives that are affected? For PlantEasily's part, it goes through all the vanilla channels to interact with each beehive and harvest it as if the player walked up to each one and interacted with it individually; albeit much more quickly and only within a single invocation of Player.Interact().

I would be more than happy to work towards a solution.

werdna87 commented 4 months ago

So I had this happen a few times on a server I am running so I decided to dig around. The only mod active is V+, and I am using an using 0.9.13.0-alpha01. After digging, it looks like you had submitted some changes to the original Valheim Plus repo that were never accepted (https://github.com/Grantapher/ValheimPlus/tree/container-modify-refactor) and never made it into your repo either. That said, looking at the way Behive.cs is implemented, it looks like the way the items is managed is different than the more recent files like Fermenter.cs and I am wondering if that is why it is happening also.

Very annoying bug, ended up losing multiple chests worth of items because of it, but I could not reproduce it on a single player world myself