Skip to content

Commit

Permalink
Merge branch 'main' of github.com:northern-information/arcologies
Browse files Browse the repository at this point in the history
  • Loading branch information
tyleretters committed Oct 20, 2021
2 parents b07d89e + d5e297b commit 93d9579
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions lib/Cell.lua
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,17 @@ function Cell:change_checks()
self:setup_notes(8)

elseif self:is("SPOMENIK")
or self:is("FRACTURE") then
or self:is("FRACTURE") then
self:set_note_count(1)
self:setup_notes(1)

elseif self:is("AUTON")
elseif self:is("AUTON")
or self:is("PRAIRIE") then
self:set_note_count(8)
self:setup_notes(8)

elseif self:is("CRYPT") then
self:set_state_index(1)
self:set_state_index(1)
self:cycle_state_index(0)

elseif self:is("KUDZU") then
Expand All @@ -231,9 +231,9 @@ end
-- all signals are "spawned" but only under certain conditions
function Cell:is_spawning()
if self:is("DOME") and self.metabolism ~= 0 then
return self.er[fn.cycle((counters:this_beat() - self.offset) % self.metabolism, 0, self.metabolism)]
return self.er[(counters:this_beat() + self.offset) % self.metabolism + 1]
elseif self:is("MAZE") and self.metabolism ~= 0 then
return self.turing[fn.cycle((counters:this_beat() - self.offset) % self.metabolism, 0, self.metabolism)]
return self.turing[(counters:this_beat() + self.offset) % self.metabolism + 1]
elseif self:is("SOLARIUM") and self.flag then
return true
elseif self:is("HIVE") or self:is("RAVE") or self:is("WINDFARM") then
Expand Down Expand Up @@ -335,4 +335,3 @@ function Cell:drugs()
end
end
end

4 changes: 2 additions & 2 deletions lib/saveload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ function saveload:load_cells(data)
-- if the structure doesn't exist anymore, load it as a hive.
tmp.structure_name = fn.table_find(structures:all_names(), load_cell[structure_key]) and load_cell[structure_key] or "HIVE"

tmp:change_checks()
for k, v in pairs(tmp:get_save_keys()) do
-- cells from older arcologies don't have newer attributes, so:
tmp[v] = load_cell[v] or tmp[v]
end
tmp:change_checks()
tmp:set_available_ports()
tmp:set_er()
table.insert(keeper.cells, tmp)
Expand Down Expand Up @@ -92,4 +92,4 @@ function saveload:collect_data_for_map_save(name)
return data
end

return saveload
return saveload

0 comments on commit 93d9579

Please sign in to comment.