[2.0.60] Leaving remote map view does not raise on_selected_entity_changed

We are aware of them, but do not have solutions that don't cause other issues. They go here in order not to take space in the main bug thread list.
Honktown
Smart Inserter
Smart Inserter
Posts: 1058
Joined: Thu Oct 03, 2019 7:10 am
Contact:

[2.0.60] Leaving remote map view does not raise on_selected_entity_changed

Post by Honktown »

What you expected:
Deselecting an entity always raises on_selected_entity_changed when it's reasonable to do so.

What happens:
It doesn't. The tooltip changes and everything

To reproduce:

Code: Select all

/c
script.on_event(defines.events.on_selected_entity_changed, function(event)
	game.print(event.tick)
end)
1) open the map, zoom in, put the mouse cursor on something (event raises)
2) press m to leave map view (event doesn't raise) even though the entity is deselected according to the tooltip
I have mods! I guess!
Link
Rseding91
Factorio Staff
Factorio Staff
Posts: 15879
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.60] Leaving remote map view does not raise on_selected_entity_changed

Post by Rseding91 »

I suspect this will be a case of “won’t fix”/“not a bug”. There are a handful of cases where the engine suppresses lua events because it is not and cannot reasonably be setup to handle if some mod did something annoying during the event.

Exiting remote view can happen for one of many reasons - such as a hub dying and the player being force ejected. In that case we can’t allow a lua event because a mod may try to put the player back in the hub which is half dead.
If you want to get ahold of me I'm almost always on Discord.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15879
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.60] Leaving remote map view does not raise on_selected_entity_changed

Post by Rseding91 »

Looking into this more, the reason the event doesn't fire is due to a technicality: the selected entity has not changed on the controller - just the active controller changed. The remote controller - in its inactive state - still has that entity selected.

However, I can't add the event when exiting remote view because of the previous mentioned reason.
If you want to get ahold of me I'm almost always on Discord.
Honktown
Smart Inserter
Smart Inserter
Posts: 1058
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: [2.0.60] Leaving remote map view does not raise on_selected_entity_changed

Post by Honktown »

Thanks for replying. I think watching on_player_controller_changed, in addition, might solve my mod's "issue" then.
I have mods! I guess!
Link
Post Reply

Return to “Minor issues”