Skip to content

Commit

Permalink
Circular Dependency #171
Browse files Browse the repository at this point in the history
Removed optional dependency on AAI Industry to fix circular reference issue
  • Loading branch information
KiwiHawk committed Feb 8, 2024
1 parent ceecbaf commit 6e8a849
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
3 changes: 2 additions & 1 deletion bobwarfare/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 1.3.0
Version: 1.2.1
Date: ???
Bugfixes:
- Fixed Artillery Turret order #165
- Removed optional dependency on AAI Industry to fix circular reference issue #171
---------------------------------------------------------------------------------------------------
Version: 1.2.0
Date: 22. 12. 2023
Expand Down
5 changes: 2 additions & 3 deletions bobwarfare/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bobwarfare",
"version": "1.3.0",
"version": "1.2.1",
"factorio_version": "1.1",
"title": "Bob's Warfare mod",
"author": "Bobingabout",
Expand All @@ -10,7 +10,6 @@
"base >= 1.1.0",
"boblibrary >= 1.2.0",
"? bobplates >= 1.2.0",
"? bobenemies >= 1.2.0",
"(?) aai-industry"
"? bobenemies >= 1.2.0"
],
"description": "Requires Bob's functions library mod.\n\nThis mod adds a lot of things for warfare.\nAdds Nitroglycerine production chain, which is used to make intermediates for new ammo.\nAdds 7 new gun ammos, shotgun ammos, and rockets based on an improved normal, and 6 elemental ammos.\nAdds a laser rifle and 7 tiers of laser ammo using glass and the 6 gems.\nAdds Tanks to tier 3, and artillery wagons to tier 3.\nChanges the way you make combat robots, and adds a 4th combat robot capsule.\nAdds a Robot laser drone.\nAdds a higher tier wall and gate\nAdds a couple new mines.\nAdds Scatter tank ammo\nAdds a few new types of artillery ammo.\nAdds more tiers of Radar.\n\nAlthough it can function as a stand alone mod, it is intended to be used with the full Bob's Mods set."}
14 changes: 5 additions & 9 deletions bobwarfare/prototypes/technology/radar.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
local radar_tech_name = nil

if mods["aai-industry"] then
if data.raw.technology["radar"] then
radar_tech_name = "radar"
end
else
if not mods["aai-industry"] then
data:extend({
{
type = "technology",
Expand All @@ -30,7 +24,6 @@ else
order = "e-b-a",
},
})
radar_tech_name = "radars-1"
end

data:extend({
Expand All @@ -40,7 +33,6 @@ data:extend({
icon = "__bobwarfare__/graphics/icons/technology/radars.png",
icon_size = 128,
prerequisites = {
radar_tech_name,
"military-2",
"steel-processing",
"electronics",
Expand Down Expand Up @@ -148,3 +140,7 @@ data:extend({
order = "e-b-e",
},
})

if not mods["aai-industry"] then
bobmods.lib.tech.add_prerequisite("radars-2", "radars-1")
end
4 changes: 3 additions & 1 deletion bobwarfare/prototypes/technology/technology-updates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,9 @@ if mods["boblogistics"] then
bobmods.lib.tech.remove_science_pack("bob-robot-plasma-drones", "chemical-science-pack")
end

if data.raw.technology["radars-1"] then
if mods["aai-industry"] then
bobmods.lib.tech.add_prerequisite("radars-2", "radar")
else
bobmods.lib.tech.add_prerequisite("artillery", "radars-1")
bobmods.lib.tech.add_prerequisite("spidertron", "radars-1")
end

0 comments on commit 6e8a849

Please sign in to comment.