[1.1.101] get_flow() on offshore pumps always returns 0 if immediately connected to a pump

We are aware of them, but they have low priority. We have more important things to do. They go here in order not to take space in the main bug thread list.
Post Reply
User avatar
blargh2015
Inserter
Inserter
Posts: 28
Joined: Sun Jun 03, 2018 3:47 pm
Contact:

[1.1.101] get_flow() on offshore pumps always returns 0 if immediately connected to a pump

Post by blargh2015 »

Offshore pumps that connect to pipes or tanks report their pumping values via entity.fluidbox.get_flow(1) correctly.

However, offshore pumps that are directly connected to pumps always return 0 for entity.fluidbox.get_flow(1), regardless of their actual flow rate.

This bug has been around a long time, but revisiting it as I'm reworking UtilizationMonitorBlargh and cleaning up some of the code from the past that's no longer needed (e.g. the long time pumpjack status bug fix that came in 1.1.92) - with this bug present I have to determine the utilization percentage of offshore pumps by:

1. get_flow(1) / entity.prototyping.pumping_speed if it's greater than 0, but it always shows 0 when this is connected to another pump. Return that value if >0
2. If entity.fluidbox[1] is nil, return 1.0 (catch case when pump connected to an empty tank and is running at full speed and thus no output buffer and avoid dereferencing nil in the next step)
3. Otherwise, return get_capacity(1) - fluidbox[1].amount / entity.prototyping.pumping_speed

Fixing this issue would allow me to drop the last 2 steps.

Save game showing this attached - has text plates mod to document it, and UtilizationMonitorBlargh for its debug command, but problem shows without either.

Thanks!
Attachments
get-flow-bug-demo.zip
(4.99 MiB) Downloaded 17 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.101] get_flow() on offshore pumps always returns 0 if immediately connected to a pump

Post by Rseding91 »

Due to the way pumps work I'm not sure if this will ever be addressed. Pumps remove fluid from the source and place it in the destination. That bypasses all 'flow' values on the source and destination.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Minor issues”