Page 1 of 1

[1.1.5] "only-in-cursor" items can be quick-inserted into entities without inventory (i.e. rocks).

Posted: Mon Dec 14, 2020 6:10 pm
by eradicator
What?

Ctrl+LeftClick on any entity with inventory and on some entities without inventory "deletes" the cursor stack if the cursor stack has the "only-in-cursor" flag.

Expected Bahavior

"only-in-cursor" items can not be inserted into anything, so they should never be affected by "insert" actions.

Reproduction

Rocks are just an example. I also confirmed it on electric-energy-interface, rail, electric-pole, ... and then i stopped testing.
  1. Press Ctrl+C to get a copy-paste tool.
  2. Walk up to a rock and press Ctrl+LeftClick.
  3. Notice how your cursor is now empty.

Re: [1.1.5] "only-in-cursor" items can be quick-inserted into entities without inventory (i.e. rocks).

Posted: Wed Dec 16, 2020 9:41 am
by Klonan
"only-in-cursor" items can not be inserted into anything, so they should never be affected by "insert" actions.
Actually they can be inserted just fine, moved with any normal item

Just they are deleted if they are ever detected outside of a cursor stack

I am tempted to call this a minor issue/not a bug/won't fix

Re: [1.1.5] "only-in-cursor" items can be quick-inserted into entities without inventory (i.e. rocks).

Posted: Wed Dec 16, 2020 11:17 am
by kovarex
Minor issue.

Re: [1.1.5] "only-in-cursor" items can be quick-inserted into entities without inventory (i.e. rocks).

Posted: Wed Dec 16, 2020 1:17 pm
by eradicator
Klonan wrote:
Wed Dec 16, 2020 9:41 am
"only-in-cursor" items can not be inserted into anything, so they should never be affected by "insert" actions.
Actually they can be inserted just fine
I meant they can't conceptually be inserted from the players perspective. Obviously it's technically working or otherwise we wouldn't be here :D. If it had only been entities *with* inventory i might not have written this, but the without thing was rather weird. It actually happend to me when i was trying to drag a selection area and accidentially held ctrl instead of shift. I can see how it's not a major issue, but was hoping that it would be as easy as adding one line of code to the quick insert. Ah well, another time then :D.

Re: [1.1.5] "only-in-cursor" items can be quick-inserted into entities without inventory (i.e. rocks).

Posted: Sat Apr 24, 2021 9:39 pm
by eradicator
Sigh. Working on Belt Planner this just cost me several hours again trying to figure out why my selection-tool suddenly disappears on ctrl-click. Until I remembered this thread...

Re: [1.1.5] "only-in-cursor" items can be quick-inserted into entities without inventory (i.e. rocks).

Posted: Sat Apr 24, 2021 9:47 pm
by eradicator
It also seems that on_player_fast_transferred is NOT raised in this case. Which isn't helping...

Re: [1.1.5] "only-in-cursor" items can be quick-inserted into entities without inventory (i.e. rocks).

Posted: Sun Apr 25, 2021 10:18 am
by eradicator
Ok...so everything I try to make this works fails.
  1. Can not prevent insertion even into neutral objects.
  2. Can not detect this happening because on_player_fast_transferred event is not raised.
  3. Can not prevent insertion because fast-transfer ignores empty player selection.
I don't know what other kind of ugly hack I'm supposed to try next :/.