Code: Select all
connectable =
(some_entity.prototype.max_circuit_wire_distance ~= nil and
some_entity.prototype.max_circuit_wire_distance ~= 0) or
(some_entity.prototype.max_wire_distance ~= nil and
some_entity.prototype.max_wire_distance ~= 0)
if connectable then
(etc.)
The reason I'm checking both wire distances is that type="electric-pole" objects seem to have max_circuit_wire_distance == 0, (which seems odd to me).