Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Furnace: Erase src_time if no more items left in src. #1457

Closed
wants to merge 1 commit into from
Closed

Furnace: Erase src_time if no more items left in src. #1457

wants to merge 1 commit into from

Conversation

sofar
Copy link
Contributor

@sofar sofar commented Dec 14, 2016

The old code would allow src_time to stay non-zero, allowing you
to insert new items in a newly loaded furnace, and instantly cook
dozens of them because of this.

If the src slot goes empty while cooking items in the cook loop,
we erase the remaining src_time and the player will have to wait
the normal time for the next items to cook.

Fixes #1455

@paramat
Copy link
Contributor

paramat commented Dec 14, 2016

@Fixer-007 can you test?

@sofar
Copy link
Contributor Author

sofar commented Dec 14, 2016

To explain, src_time contains available "time" accrued (while gone). It can just keep counting upwards. In the loop, it gets decreased for every item cooked. But if we drain the src, we shouldn't keep any accrued time left in there, since it can be very large - it can go as high as 370 with coal blocks, which is 100+ sand nodes.

@sofar
Copy link
Contributor Author

sofar commented Dec 14, 2016

You modified the original bug report to include a different bug, AFTER I submitted a fix for it. That's really bad, you should NOT do that. If you keep doing this, you could never close bugs.

For all new bugs found, just make a new bugreport.

@Fixer-007
Copy link
Contributor

Fixer-007 commented Dec 14, 2016

You are correct, I've split that bug report in two.

This PR solves furnace instacook issue described by me in #1455.

👍

The fuel would remain active even if source went empty, giving
free cook time to newly inserted items. This patch is supposed
to stop this.
@sofar
Copy link
Contributor Author

sofar commented Dec 15, 2016

@fixer please give this another test. If this doesn't work I might throw in the towel.

@Fixer-007
Copy link
Contributor

Fixer-007 commented Dec 15, 2016

Fixes the #1459 to me. 👍

@sofar
Copy link
Contributor Author

sofar commented Dec 15, 2016

Alright, then we should give this some more testing then.

@Fixer-007
Copy link
Contributor

Fixer-007 commented Dec 15, 2016

I will suggest using this new furnace code to Cash World admin here: https://forum.minetest.net/viewtopic.php?f=10&t=14429&p=242724#p242724

@paramat
Copy link
Contributor

paramat commented Dec 16, 2016

I don't feel able to get my head around this code, but since i somewhat trust sofar with this code and since it is tested i'm happy to 👍 to get it merged and tested more widely.

@Fixer-007
Copy link
Contributor

Fixer-007 commented Dec 16, 2016

This PR is already installed on Cash World server, will see if someone spots something critical.

@paramat
Copy link
Contributor

paramat commented Dec 17, 2016

e5c5c26

@paramat paramat closed this Dec 17, 2016
@sofar sofar deleted the furnacebgfix branch December 21, 2016 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants