Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Bug in ResourceUpdate::SetNextQueueTechOnTop #356

Open
ScuroGuardiano opened this issue Mar 27, 2019 · 1 comment
Open

Bug in ResourceUpdate::SetNextQueueTechOnTop #356

ScuroGuardiano opened this issue Mar 27, 2019 · 1 comment

Comments

@ScuroGuardiano
Copy link

I don't know if this project is still maintained, but I'll leave this issue for people who wants to use it. Just to they be aware of this little bug.

The bug

There's a bug in includes/classes/class.PlanetRessUpdate.php while updating research. Exactly in SetNextQueueTechOnTop method. It is using resources before any resource update. So it checks if you have enough resources on planet to research based on old planet state.

Example

You got 10000 metal, produce 7000/h. You plan 3 research tasks, each take 1h and each costs 7000 metal. So they all should be done, because each takes 1h to do and 7000 metal and you produce 7000 metal per hour. But only one will be done. After setting first, you had 3000 metal. And this 3000 metal will be used to check if you have enough resources in SetNextQueueTechOnTop.

One more thing...

To solve this problem you can't simply add this->UpdateResources(time), because this will update resources twice in some cases. You have to change a little bit how ResourceUpdate class works or deal with this bug 😄 Maybe I will write solution to this one day 🔧

PS: Sorry for my english, I am trying my best ^^

@yamilrh
Copy link

yamilrh commented May 20, 2019

good, interesting what you say, finally you gave with the solution would be kind to share

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants