Page 1 of 1
[0.18.22] Improve error message about wrong next_upgrade
Posted: Wed May 06, 2020 4:23 pm
by SuperSandro2000
I think I get what this message means but it is not obvious on the first or second read. It could get some love and improvement in the wording.
Re: [0.18.22] Improve error message about wrong next_upgrade
Posted: Wed May 06, 2020 5:17 pm
by Rseding91
That's one of the more verbose messages in the game. I don't really know how it could be made "better" (aside from removing the result result typo).
Entity must produce no item result or mine to an item that isn't hidden.
What exactly is missing from that?
Also, this isn't a bug but a suggestion.
Re: [0.18.22] Improve error message about wrong next_upgrade
Posted: Wed May 06, 2020 5:41 pm
by posila
Rseding91 wrote: ↑Wed May 06, 2020 5:17 pmEntity must produce no item result or ...
That hurts my head a little bit ... but also it seems wrong? The mining result must have exactly one item product, and that item must not be hidden. Or maybe the check in code is wrong and it should allow entities that don't have any item product in their mining result?
Re: [0.18.22] Improve error message about wrong next_upgrade
Posted: Wed May 06, 2020 6:26 pm
by Rseding91
posila wrote: ↑Wed May 06, 2020 5:41 pm
Rseding91 wrote: ↑Wed May 06, 2020 5:17 pmEntity must produce no item result or ...
That hurts my head a little bit ... but also it seems wrong? The mining result must have exactly one item product, and that item must not be hidden. Or maybe the check in code is wrong and it should allow entities that don't have any item product in their mining result?
The check in the code does allow that. That's what the error says: it must produce nothing, or must produce an item that isn't hidden.
Re: [0.18.22] Improve error message about wrong next_upgrade
Posted: Wed May 06, 2020 6:48 pm
by posila
As far as I can reason about the code, the check doesn't allow for "produce nothing".
The check is
Code: Select all
if (prototype->minableProperties.hidden())
and hidden() does
Code: Select all
bool MinableProperties::hidden() const
{
return this->minable &&
this->products.size() == 1 &&
!this->products.front()->getItemID().isZero() &&
!this->products.front()->getItemID().getPrototype()->isVisible();
}
Must be minable, must have exactly 1 product, which must be item, which must be visible.
And I didn't see any early exit that would skip this check entirely.
Re: [0.18.22] Improve error message about wrong next_upgrade
Posted: Wed May 06, 2020 8:05 pm
by Rseding91
If the thing doesn't have any item products when mined ::hidden() will return false and the code will continue.
On the next line it checks if !minable and if it is, then either it has zero items when mined or produces a non-hidden item.
Re: [0.18.22] Improve error message about wrong next_upgrade
Posted: Wed May 06, 2020 8:10 pm
by posila
*facepalm*, yep, you are correct.
Re: [0.18.22] Improve error message about wrong next_upgrade
Posted: Tue Jul 09, 2024 10:13 pm
by OminousZ
What item conflicts exactly? where did the error occur? Help me help you help us all.