I have a simple LUA question:
LUAentity contains "backer_name" that is only instancied for trainstops and labs.
If, for example, I want to check the content of player.selected and test if
backer_name exits on the selected entity, how can I do it without making factorio
stop for a LUA error ?
I tried testing player.selected.backer_name is nil. It does not work...
I tried testing type(player.selected.backer_name) is nil . Neither...
any idea ?
I could check the prototype to test for lab or trainstop like
selected.type == "train-stop" or selected.type == "lab"
But imagine the devs adds one day another entity with backer_name...
I would like something more proofed.
