Updating tiles in all 4 directions on top-down level

Hello,

I’m trying to have a “lamp tile” put into an “on” state when the tile next to it is a “power tile”. Now, this works as expected, but if I were to place a second “power tile” next to the “lamp tile” and remove any of the placed “power tile” then the “lamp tile” would change to an “off” state even though there is still a “power tile” next to it.

There is also the problem of placing a “power tile” down before the “lamp tile” and then the “lamp tile” doesn’t realise it’s being powered so stays off.

gyfcat:

Code:
https://gist.github.com/AndreasElia/94faf2439204e90a3cab

Thanks in advance, I’ve been attempting to fix this all day but can’t seem to solve it! :frowning: