Skip to content

Commit

Permalink
Assume EEIs are power producers. (#229)
Browse files Browse the repository at this point in the history
This fixes #226 and ShadowTheAge#205.

There are still improvements possible; see #228 for more, but I think
that's a separate issue.
  • Loading branch information
shpaass authored Aug 9, 2024
2 parents 269c5a0 + b18061a commit 187de54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Yafc.Parser/Data/FactorioDataDeserializer_Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,9 @@ private void DeserializeEntity(LuaTable table, ErrorCollector errorCollector) {
entity.size = table.Get("selection_box", out LuaTable? box) ? GetSize(box) : 3;

_ = table.Get("energy_source", out LuaTable? energySource);
if (factorioType != "generator" && factorioType != "solar-panel" && factorioType != "accumulator" && factorioType != "burner-generator" && factorioType != "offshore-pump" && energySource != null) {
// These types have already called ReadEnergySource/ReadFluidEnergySource (generator, burner generator) or don't consume energy from YAFC's point of view (pump to EII).
// TODO: Work with AAI-I to support offshore pumps that consume energy.
if (factorioType is not "generator" and not "burner-generator" and not "offshore-pump" and not "solar-panel" and not "accumulator" and not "electric-energy-interface" && energySource != null) {
ReadEnergySource(energySource, entity, defaultDrain);
}

Expand Down
2 changes: 2 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Version
Date:
Bugfixes:
- Refuse to accept negative numbers in several places where they don't make sense.
- Handle electric energy interfaces better (e.g. pY's fish turbines, Nullius's wind turbines) when used to
generate power.
Internal changes:
- Refactor a lot of the drawing code to increase both UI consistency and consistency in being able to pass
options to methods that should accept them.
Expand Down

0 comments on commit 187de54

Please sign in to comment.