Llama3013 / vsmod-Alchemy

A vintage story mod that adds potions that enhance the player.
Other
4 stars 2 forks source link

Stacked flasks don't get consumed #6

Open squ1b3r opened 2 years ago

squ1b3r commented 2 years ago

Vintage Story - version 1.16.4 Alchemy - version 1.6.0

Steps to reproduce:

So ultimately, two flasks can be used forever. Ideally, it should be the same as pies. Once you use a flask from a stack, it breaks the stack separating partially used flask.

Llama3013 commented 2 years ago

Hi squ1b3r, this is my bad. I did all my testing for stacking with filling and emptying the flasks, I forgot to drink it while stacked. I will look into this today or tomorrow.

Llama3013 commented 2 years ago

Hi squ1b3r, I checked on this and couldn't reproduce the problem but then I updated to the latest vintagestory version 1.6.4 and found this bug as well. It seems that the new bug fixes to liquids stacking has changed something. It's probably an easy fix but the vintagestory git has not been updated to 1.6.4 so I don't know exactly whats changed. Hopefully I can fix it without seeing the new version's code but we will see.

squ1b3r commented 2 years ago

@Llama3013 Ah, interesting. Do you know where the code in question is located? We could decompile two different versions and compare the files.

Llama3013 commented 2 years ago

If I would to guess it would probably in the BlockLiquidContainerBase class. I will check if the splitStackAndPerformAction method has changed with dnspy sometime today.

squ1b3r commented 2 years ago

One thing I noticed is that Expanded Foods also has the same issue with bottles of wine. I can't really test it right now but could it be that it's a game issue and not the mod?

Llama3013 commented 2 years ago

I have investigated this further and it seems like it isn't a problem with taking out a flask and giving a new flask with the content changed. It seems to be that when the player drinks some of the potion, they are given the flask with the changed content amount and it automatically merges with the rest of the stack. When it merges it gains the content amount of the original stack. The only way I would be able to fix it would harmony patch or create a new liquidContainerBase.