Skip to content

Commit 187de54

Browse files
authored
Assume EEIs are power producers. (#229)
This fixes #226 and ShadowTheAge#205. There are still improvements possible; see #228 for more, but I think that's a separate issue.
2 parents 269c5a0 + b18061a commit 187de54

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Yafc.Parser/Data/FactorioDataDeserializer_Entity.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,9 @@ private void DeserializeEntity(LuaTable table, ErrorCollector errorCollector) {
435435
entity.size = table.Get("selection_box", out LuaTable? box) ? GetSize(box) : 3;
436436

437437
_ = table.Get("energy_source", out LuaTable? energySource);
438-
if (factorioType != "generator" && factorioType != "solar-panel" && factorioType != "accumulator" && factorioType != "burner-generator" && factorioType != "offshore-pump" && energySource != null) {
438+
// These types have already called ReadEnergySource/ReadFluidEnergySource (generator, burner generator) or don't consume energy from YAFC's point of view (pump to EII).
439+
// TODO: Work with AAI-I to support offshore pumps that consume energy.
440+
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) {
439441
ReadEnergySource(energySource, entity, defaultDrain);
440442
}
441443

changelog.txt

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

0 commit comments

Comments
 (0)