jamesbirtles / ImmersiveIntegration

Integrates IE with other mods, as well as some useful addition to IE itself
http://www.curseforge.com/projects/232159/
21 stars 10 forks source link

Industrial Coke Oven shows negative fluid values #50

Closed angelnc1989 closed 8 years ago

angelnc1989 commented 8 years ago

When the Industrial Coke Ovens internal fluid tank is full it somehow shows negative values in the GUI, WAILA however shows the correct 64000/64000mb. http://imgur.com/a/0r82c

jamesbirtles commented 8 years ago

That's... interesting I'll try to reproduce

2bithacker commented 8 years ago

I'm seeing this as well, and I think it may cause the ICO to keep processing input even though it isn't making any more liquid. Maybe that's intentional, but normal Coke Ovens halt if their tanks fill. I'll see if I can confirm the behavior and document it a bit.

jamesbirtles commented 8 years ago

It is intended that it will keep processing even if the liquid cannot fit

compwiz1548 commented 8 years ago

I've noticed this as well, however I'm seeing it when using a TC drain to remove creosote. The tank goes negative and it just keeps pouring, effectively giving infinite creosote. This is using FTB Infinity 2.2.2.

defakto commented 8 years ago

Also had the same issue today with Immersive integration 0.6.6, FTB infinity 2.3.3

Just got it to roll over again while watching. I think it's an integer issue for the value you're storing in the creosote tank.

It appeared that the roll over happened around as I crossed over 32,000 creosote in the tank. You are probably using a signed, 16 bit integer which tops out at 32,767. Once you cross that value, you're rolling over to the negative.

You just need a check to prevent overflowing your integer, both signed or unsigned. Seems to be just a GUI error, as putting bottles in outputs what you would expect.

Series of shots showing:

Early Run: 2016-02-28_12 05 02

Near 32,767 2016-02-28_12 05 42

Just passed over 32,767 2016-02-28_12 06 24

jamesbirtles commented 8 years ago

TIL sendProgressBarUpdate sends a short in the packet instead of the int it takes :flushed: