PC's Infinite Ammo Rebalanced


Adds versions of all ammo that never run out. Rebalanced to make the recipe more 'fair'.

Content
5 months ago
2.0
262
Combat

g Patch: replace rusty-locale with flib

14 days ago

Hi A-Vladimir,

rusty-locale's README says its 2.0 version is a stop-gap and asks dependent mods to move to flib, and it doesn't load on Factorio 2.1. I've made the switch for this mod, in case it saves you some time. The same change is open as a PR for the original PC's Infinite Ammo (GitHub, ProfessorConfundus/PCs-Infinite-Ammo#10).

It's four lines in items.lua and one in info.json: the rustyLocale.of_item(...) calls become flibLocale.of_item(...). flib returns the LocalisedString itself rather than a {name, description} table, so the .name lookups go away. The dependency becomes flib >= 0.16.3.

Tested on 2.1.22 with Space Age, Krastorio 2 and More_Ammo, version tag bumped for the test. Every prototype the mod creates with rusty-locale comes out identical with flib. One side effect: the mod's position in the load order changes, because its dependency is now flib. In my modpack it now runs after More_Ammo's data-final-fixes, so More_Ammo's high-capacity magazines also get unlimited versions (12 extra items, with their tech unlocks). Nothing else changed.

--- PCs-Infinite-Ammo-Rebalanced_0.3.4/items.lua    2026-05-23 21:18:52.000000000 +0400
+++ PCs-Infinite-Ammo-Rebalanced_0.3.4/items.lua    2026-10-18 15:20:31.408744700 +0400
@@ -1,4 +1,4 @@
-local rustyLocale = require '__rusty-locale__.locale'
+local flibLocale = require '__flib__.locale'
 local special = false

 local generatedPrototypes = {}
@@ -39,9 +39,9 @@
        log("Icons and icon is missing for "..currentWorkingPrototype.name..". Will probably break if anything is changed")
    end

-    local currentWorkingPrototypeLocale = rustyLocale.of_item(prototype)
-    currentWorkingPrototype.localised_name = {"naming-scheme.name", currentWorkingPrototypeLocale.name}
-    currentWorkingPrototype.localised_description = {"naming-scheme.description", currentWorkingPrototypeLocale.name}
+    local currentWorkingPrototypeLocale = flibLocale.of_item(prototype)
+    currentWorkingPrototype.localised_name = {"naming-scheme.name", currentWorkingPrototypeLocale}
+    currentWorkingPrototype.localised_description = {"naming-scheme.description", currentWorkingPrototypeLocale}

     table.insert(generatedPrototypes, currentWorkingPrototype)

@@ -71,9 +71,9 @@
         results = {{type="item", name="pc-unlimited-" .. prototype.name, amount=1}}
     }

-    local currentWorkingRecipeLocale = rustyLocale.of_item(prototype)
-    currentWorkingRecipe.localised_name = {"naming-scheme.name", currentWorkingRecipeLocale.name}
-    currentWorkingRecipe.localised_description = {"naming-scheme.description", currentWorkingRecipeLocale.name}
+    local currentWorkingRecipeLocale = flibLocale.of_item(prototype)
+    currentWorkingRecipe.localised_name = {"naming-scheme.name", currentWorkingRecipeLocale}
+    currentWorkingRecipe.localised_description = {"naming-scheme.description", currentWorkingRecipeLocale}

     table.insert(generatedRecipes, currentWorkingRecipe)

@@ -91,7 +91,7 @@
     }
 }

-local testItemLocale = rustyLocale.of_item(testItemPrototype)
+local testItemLocale = flibLocale.of_item(testItemPrototype)

 for index, value in ipairs(generatedPrototypes) do
     data:extend{value, generatedRecipes[index]}
--- PCs-Infinite-Ammo-Rebalanced_0.3.4/info.json    2026-05-23 21:15:14.000000000 +0400
+++ PCs-Infinite-Ammo-Rebalanced_0.3.4/info.json    2026-10-18 15:20:31.408744700 +0400
@@ -4,6 +4,6 @@
     "title": "PC's Infinite Ammo Rebalanced",
     "author": "ProfessorConfundus",
     "factorio_version": "2.0",
-    "dependencies": ["base >= 2.0", "rusty-locale >= 1.0.16"],
+    "dependencies": ["base >= 2.0", "flib >= 0.16.3"],
     "description": "Adds versions of all ammo that never run out. Rebalanced to make the recipe more 'fair'."
 }

Abbas

New response