[0.18.22] Improve error message about wrong next_upgrade

User avatar
SuperSandro2000
Filter Inserter
Filter Inserter
Posts: 742
Joined: Sun Jan 12, 2014 3:54 am
Contact:

[0.18.22] Improve error message about wrong next_upgrade

Post 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.

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

Re: [0.18.22] Improve error message about wrong next_upgrade

Post 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.
If you want to get ahold of me I'm almost always on Discord.
posila
Factorio Staff
Factorio Staff
Posts: 5406
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.18.22] Improve error message about wrong next_upgrade

Post 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?
Rseding91
Factorio Staff
Factorio Staff
Posts: 14567
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.18.22] Improve error message about wrong next_upgrade

Post 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.
If you want to get ahold of me I'm almost always on Discord.
posila
Factorio Staff
Factorio Staff
Posts: 5406
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.18.22] Improve error message about wrong next_upgrade

Post 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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14567
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.18.22] Improve error message about wrong next_upgrade

Post 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.
If you want to get ahold of me I'm almost always on Discord.
posila
Factorio Staff
Factorio Staff
Posts: 5406
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.18.22] Improve error message about wrong next_upgrade

Post by posila »

*facepalm*, yep, you are correct.
OminousZ
Burner Inserter
Burner Inserter
Posts: 6
Joined: Fri Mar 01, 2019 4:23 pm
Contact:

Re: [0.18.22] Improve error message about wrong next_upgrade

Post by OminousZ »

What item conflicts exactly? where did the error occur? Help me help you help us all.
Post Reply

Return to “Implemented mod requests”