Page 1 of 1

[1.1.69] Highlight-box targeting entity not visible if tick is paused

Posted: Sat Sep 24, 2022 11:54 pm
by GlassBricks
Steps to reproduce:

- Create a freeplay save (no mods)
- Go to editor mode (this pauses ticks)
- Build an entity (tested with iron-chest)
- Create a highlight box around that entity ( /c game.surfaces[1].create_entity{name = "highlight-box", position = game.player.selected.position, target = game.player.selected} )

I expect to see the highlight box, however, the highlight box is not be visible until ticks are un-paused.

Highlight boxes will still appear around other entities (like generated trees, etc.) or entities built before ticks were paused.
Also reproducing this is a bit finnicky; sometimes the highlight box still becomes visible on a just-built entity when ticks are paused. However following the above steps exactly does consistently reproduce this.

Use case (how I found this bug):
I have a mod which is meant to be used in editor mode, where highlight boxes are used as indicators. However, when the tick is paused (which is normal in editor mode), sometimes the highlight boxes aren't visible until ticks are unpaused. Investigating with no mods in freeplay led to the above.

Re: [1.1.69] Highlight-box targeting entity not visible if tick is paused

Posted: Mon Sep 26, 2022 9:27 am
by boskid
Ok, i did tiny tweaks to make the HighlightBoxEntity behave slightly better: it will perform copy of target's selectionBox immediately during construction without waiting for next update call. That has some important behavior changes because copy of this selection box is then used as a bounding box of this entity which has to be in correct place of a surface to be rendered. Before fix it would get a default bounding box which would register the HighlightBoxEntity on advanced tiles somewhere near the {0,0} which causes issues not only related to rendering.

Issue should be now fixed for 1.1.70.