Page 1 of 1

[2.0.60] Leaving remote map view does not raise on_selected_entity_changed

Posted: Sat Jul 19, 2025 2:52 pm
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

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

Posted: Sun Jul 20, 2025 1:49 pm
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.