[1.1.61] Empty whitelist filter in selection-tool.*_filters is treated as no filter.

Bugs that are actually features.
Post Reply
Sopel
Long Handed Inserter
Long Handed Inserter
Posts: 61
Joined: Mon Sep 24, 2018 8:30 pm
Contact:

[1.1.61] Empty whitelist filter in selection-tool.*_filters is treated as no filter.

Post by Sopel »

https://wiki.factorio.com/Prototype/Sel ... le_filters when set to an empty table (={}), along with filter_mode set to "whitelist", results in everything being whitelisted, which is consistent with the filter being nil. An empty whitelist should mean nothing is allowed.

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

Re: [1.1.61] Empty whitelist filter in selection-tool.*_filters is treated as no filter.

Post by Rseding91 »

What is the utility in an empty whitelist mode essentially saying 'nothing can be selected by this'? Why have it exist at all if it can not select anything?
If you want to get ahold of me I'm almost always on Discord.

Xoriun
Long Handed Inserter
Long Handed Inserter
Posts: 66
Joined: Wed Apr 01, 2020 11:31 am
Contact:

Re: [1.1.61] Empty whitelist filter in selection-tool.*_filters is treated as no filter.

Post by Xoriun »

The suggested behaviour could be a protection against basically setting a map to public by removing the last entry of the whitelist.
But I don't really know if that is enough reason.

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

Re: [1.1.61] Empty whitelist filter in selection-tool.*_filters is treated as no filter.

Post by Rseding91 »

An empty whitelist being 'allow all' does seem wrong. But the fix seems like it should be: if whitelist and the list is empty throw an error. Unless someone has a use-case for an empty whitelist mode they can think of.
If you want to get ahold of me I'm almost always on Discord.

robot256
Filter Inserter
Filter Inserter
Posts: 596
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [1.1.61] Empty whitelist filter in selection-tool.*_filters is treated as no filter.

Post by robot256 »

(This is about selection tool items, not multiplayer game allowed players lists)

What if you want the player to select an area with a tool to get the coordinates, but don't want any entities to be highlighted when doing so? That's the behavior I would expect if it worked how Sopel expected. Or is there a better way to get the same effect?

curiosity
Filter Inserter
Filter Inserter
Posts: 325
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: [1.1.61] Empty whitelist filter in selection-tool.*_filters is treated as no filter.

Post by curiosity »

robot256 wrote:
Sat Jul 02, 2022 8:12 pm
What if you want the player to select an area with a tool to get the coordinates, but don't want any entities to be highlighted when doing so? That's the behavior I would expect if it worked how Sopel expected. Or is there a better way to get the same effect?
SelectionTool.selection_mode

The actual concern here should be about the flags described as "normal rules". Can these "normal rules" be decomposed into a set of rules that will let you avoid setting filters? For example, what if someone wants a selection of blueprintable entities and only entities specifically? Or tiles?

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [1.1.61] Empty whitelist filter in selection-tool.*_filters is treated as no filter.

Post by Klonan »

robot256 wrote:
Sat Jul 02, 2022 8:12 pm
What if you want the player to select an area with a tool to get the coordinates, but don't want any entities to be highlighted when doing so?
This is quite easy, you can just combine two mutually exclusive type filters in the selection mode, such a `friend` and `enemy`:

Code: Select all

  selection_mode = {"friend", "enemy"}

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2250
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.61] Empty whitelist filter in selection-tool.*_filters is treated as no filter.

Post by boskid »

Thanks for the report. If your intention is to not select any entities you can use the "nothing" selection_mode flags.

Post Reply

Return to “Not a bug”