Nanobots: Early Bots 3.0


Personal construction nanobots with quality support - Enhanced Performance Edition Personal nanobots for construction, repair, and turret ammo delivery - no roboports needed! Features quality support, combat automation, statistics GUI, and megabase optimization. Fully compatible with Factorio 2.0 and Space Age.

Content
13 days ago
2.0 - 2.1
6.43K
Logistic network

b Unnecessary pcall around bad .valid check

13 days ago

if not ghost.valid and not ghost.to_be_upgraded() will die on an invalid ghost. Nanotbots2-continued fixes this with if not (ghost and ghost.valid and ghost.to_be_upgraded()), which would save you a pcall().

13 days ago

Thanks for pointing this out!

I checked both currently maintained branches, and you were right about the unnecessary pcall. There were still some older defensive pcall wrappers around to_be_upgraded() / to_be_deconstructed() even after the entity had already passed a validity check.

I've cleaned those up in both branches while leaving the other defensive calls in place where they're still appropriate.

The fixes are now available on the Mod Portal:

Nanobots3 5.8.12 for Factorio 2.0
Nanobots3 5.9.2 for Factorio 2.1

Thanks for catching this and taking the time to report it!

New response