Carna


○🌐Adds planet Carna to Space Age, a cold and snowy planet with dormant mechanoids scattered all across the surface.

Content
4 days ago
2.0 - 2.1
14.6K
Factorio: Space Age Icon Space Age Mod
Planets Enemies Mining Fluids

b Crash at control.lua:372 (storage.carnan_spire is nil)

a month ago

Hi! Carna 0.3.24 can fail every 10 s with __carna__/control.lua:372: bad argument #1 of 2 to 'pairs' (table expected, got nil). run_spire_tick iterates storage.carnan_spire, but that table is only created in spire_built (349), which runs from on_built_entity / on_robot_built_entity (785-800) and only for the name carnan-spire (346). The surface is marked separately by the spire-mark created_effect (885-891) of any entity that carries it, so after the spire technology is researched, a surface that got a spire another way (script create_entity, clone, or a copy of the prototype from another mod) ends in this error, and it keeps failing after the entity is removed because spire_marked_surfaces stays set. Tenebris Prime's bioluminescent copy of the spire hits this: https://github.com/nicholasgower/tenebris-prime/issues/40

Repro: mark the technology researched, surface.create_entity{name="carnan-spire", ...} from a script, wait 600 ticks. Creating storage.carnan_spire in setup_tables (or pairs(storage.carnan_spire or {})) would fix it.

New response