From 6e8a84981f6e2030d44b8304fe52814be7e0a780 Mon Sep 17 00:00:00 2001 From: KiwiHawk <59639+KiwiHawk@users.noreply.github.com> Date: Thu, 8 Feb 2024 21:24:51 +1300 Subject: [PATCH] Circular Dependency #171 Removed optional dependency on AAI Industry to fix circular reference issue --- bobwarfare/changelog.txt | 3 ++- bobwarfare/info.json | 5 ++--- bobwarfare/prototypes/technology/radar.lua | 14 +++++--------- .../prototypes/technology/technology-updates.lua | 4 +++- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/bobwarfare/changelog.txt b/bobwarfare/changelog.txt index a6390434d..17f1e8efc 100644 --- a/bobwarfare/changelog.txt +++ b/bobwarfare/changelog.txt @@ -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 diff --git a/bobwarfare/info.json b/bobwarfare/info.json index c459286a8..85c359bca 100644 --- a/bobwarfare/info.json +++ b/bobwarfare/info.json @@ -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", @@ -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."} diff --git a/bobwarfare/prototypes/technology/radar.lua b/bobwarfare/prototypes/technology/radar.lua index 0c569f696..ec5fade86 100644 --- a/bobwarfare/prototypes/technology/radar.lua +++ b/bobwarfare/prototypes/technology/radar.lua @@ -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", @@ -30,7 +24,6 @@ else order = "e-b-a", }, }) - radar_tech_name = "radars-1" end data:extend({ @@ -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", @@ -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 diff --git a/bobwarfare/prototypes/technology/technology-updates.lua b/bobwarfare/prototypes/technology/technology-updates.lua index 554f91d8d..b98ca7efb 100644 --- a/bobwarfare/prototypes/technology/technology-updates.lua +++ b/bobwarfare/prototypes/technology/technology-updates.lua @@ -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