cmss13-devs / cmss13

Contains the code for CM-SS13
https://cm-ss13.com
GNU Affero General Public License v3.0
98 stars 555 forks source link

Chemical Mixhaps #1932

Open yoyoyo881 opened 1 year ago

yoyoyo881 commented 1 year ago

Testmerges

1834

Description of the bug

When combining chemicals, especially as an OT, occasionally some error occurs and there will be some crazy decimal value left as extra. Not usually a big deal, but it can be annoying to remove the extra. When mixing ANFO earlier as an OT, I filled a bucket with welding fuel and manually added ammonia nitrate below the threshold to explode. During one of these mixtures, I believe a trace amount of ammonia nitrate was left over, so when I added an extra 60u of ammonia nitrate to the whole container of fuel, that trace amount also was included in the reaction and caused all of OT to be destroyed.

What's the difference with what should have happened?

That .22222211231u of ammonia nitrate shouldn't have been left over.

How do we reproduce this bug?

  1. Play as an OT. When combining chemicals, this usually happens,

Issue Bingo

Herotitan772 commented 1 year ago

its to do with chemicals mixing in full containers or using not using round numbers when mixing chemicals, for example, lets say your trying to make formaldehyde in a tank with silver reagent, you add 100 silver into the tank then 300 methane, then 300 phoron and finally when you add 300 oxygen it will most likely fuck up because your adding 300 units to a tank with 700/1000 capacity remaining and when they react think of it like there is no space for the reaction to take place so the game has to delete some of each of the chemicals in order to allow for the required mixing space (i doubt this is the real reason the game does this, this is just how i wrap my head around it). so after you add the 300 oxygen you will be left with something like 0.001 methane and phoron, plus 100 silver, and the rest will be formaldehyde (it might not do it every time but it will do it more often than not)

an easy fix is to always use the biggest containers available and always make sure you have something like 30 units of free space in any containers your working in. do that and you should be sweet. also always use round numbers when mixing and if a reagent says it needs at least 5 units then just use 10 to avoid any fucky wuckys

Huffie56 commented 1 year ago

@ItsVyzo i don't think that could be consider a bug since as the comment say above you can work around it with a proper protocol when you mix chems around... it's more of an ask for QOL improvement i think...

ItsVyzo commented 1 year ago

@ItsVyzo i don't think that could be consider a bug since as the comment say above you can work around it with a proper protocol when you mix chems around... it's more of an ask for QOL improvement i think...

Still a bug tbh since it breaks mechanics despite the temporary work around. An easy fix would be to have it round down or round up depending on X > 0.5 or X < 0.5

ghost commented 10 months ago

@Segrain