🌐Dea Dia System (ALPHA)


A group of planets still orbiting their dead star.

Content
3 days ago
2.0
11.5K
Factorio: Space Age Icon Space Age Mod
Planets Transportation Logistics Combat Armor Enemies Environment Mining Fluids Logistic network Manufacturing Power

g Crash when placing Air pump

Receiving this message when placing my first Air pump on Dea Dia:

The mod ○🌐Dea Dia System (ALPHA) (0.30.14) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event dea-dia-system::on_script_trigger_effect (ID 171)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
[C]: in function 'index'
__dea-dia-system
/control/air-pump.lua:13: in function 'air_pump_handler'
dea-dia-system/control.lua:74: in function <dea-dia-system/control.lua:72>

3 days ago

Yup same full game crash, both when a bot puts it down and you place it manually.

The mod ○🌐Dea Dia System (ALPHA) (0.30.14) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event dea-dia-system::on_script_trigger_effect (ID 170)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
[C]: in function 'index'
__dea-dia-system
/control/air-pump.lua:13: in function 'air_pump_handler'
dea-dia-system/control.lua:74: in function <dea-dia-system/control.lua:72>

3 days ago
(updated 3 days ago)

Made a quick fix, replace the file control.lua with this:

This does stress out the game thinking the entity was destroyed every time you put it down though heh

-- replace the air pump with the correct variant.
return function(event)
local source = event.source_entity
local surface = source.surface
local planet = surface.name
local target_name = planet .. "-planetary-air-pump"

if prototypes.entity[target_name] ~= nil then
    -- 1. Store all necessary information from the source entity first.
    local pos = source.position
    local dir = source.direction
    local a_force = source.force
    local qual = source.quality

    -- 2. NOW it is safe to destroy the source entity.
    source.die()

    -- 3. Create the new entity using the stored information.
    surface.create_entity{
        name = target_name,
        position = pos,
        direction = dir,
        force = a_force,
        quality = qual
    }
end

end

3 days ago

I just moved the "die" call to the end of the if.

Thanks for the quick fix! I'm enjoying the mod!

3 days ago

Sorry for the bad first fix. (:

New response