Skip to content

Commit f1f4117

Browse files
authored
Fix blueprint revive and missing script raise event (#401)
Fixes: #397
1 parent 06d9845 commit f1f4117

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

exp_legacy/module/modules/gui/rocket-info.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ Event.on_nth_tick(150, function()
549549
end)
550550

551551
--- Adds a silo to the list when it is built
552-
--- @param event EventData.on_built_entity | EventData.on_robot_built_entity
552+
--- @param event EventData.on_built_entity | EventData.on_robot_built_entity | EventData.script_raised_built | EventData.script_raised_revive
553553
local function on_built(event)
554554
local entity = event.entity
555555
if entity.valid and entity.name == "rocket-silo" then
@@ -559,6 +559,8 @@ end
559559

560560
Event.add(defines.events.on_built_entity, on_built)
561561
Event.add(defines.events.on_robot_built_entity, on_built)
562+
Event.add(defines.events.script_raised_built, on_built)
563+
Event.add(defines.events.script_raised_revive, on_built)
562564

563565
--- Redraw the progress section on role change
564566
local function role_update_event(event)

exp_scenario/module/commands/repair.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ Commands.new("repair", { "exp-commands_repair.description" })
2424
force = force,
2525
}
2626

27+
local param = { raise_revive = true } --- @type LuaEntity.silent_revive_param
2728
for _, entity in ipairs(entities) do
28-
-- TODO test for ghost not being a blueprint, https://forums.factorio.com/viewtopic.php?f=28&t=119736
29-
if not config.disallow[entity.ghost_name] and (config.allow_blueprint_repair or true) then
29+
if not config.disallow[entity.ghost_name] and (config.allow_blueprint_repair or entity.created_by_corpse) then
3030
revive_count = revive_count + 1
31-
entity.silent_revive()
31+
entity.silent_revive(param)
3232
end
3333
end
3434

0 commit comments

Comments
 (0)