fix k2 realistic weapons off
This commit is contained in:
parent
1663a51e7d
commit
2cd53c60d8
3 changed files with 24 additions and 1 deletions
|
|
@ -1,4 +1,9 @@
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
|
Version: 0.1.5
|
||||||
|
Date: 2021-06-15
|
||||||
|
Fixes:
|
||||||
|
- Fix K2 Issue when more realistic weapons is off, and more general duplicate fix.
|
||||||
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 0.1.4
|
Version: 0.1.4
|
||||||
Date: 2021-06-15
|
Date: 2021-06-15
|
||||||
Features:
|
Features:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "bztungsten",
|
"name": "bztungsten",
|
||||||
"version": "0.1.4",
|
"version": "0.1.5",
|
||||||
"factorio_version": "1.1",
|
"factorio_version": "1.1",
|
||||||
"title": "Tungsten",
|
"title": "Tungsten",
|
||||||
"author": "Brevven",
|
"author": "Brevven",
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,12 @@ end
|
||||||
|
|
||||||
function add_ingredient(recipe, ingredient, quantity)
|
function add_ingredient(recipe, ingredient, quantity)
|
||||||
if recipe ~= nil and recipe.ingredients ~= nil then
|
if recipe ~= nil and recipe.ingredients ~= nil then
|
||||||
|
for i, existing in pairs(recipe.ingredients) do
|
||||||
|
if existing[1] == ingredient or existing.name == ingredient then
|
||||||
|
log("Not adding "..ingredient.." -- duplicate")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
table.insert(recipe.ingredients, {ingredient, quantity})
|
table.insert(recipe.ingredients, {ingredient, quantity})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -127,6 +133,12 @@ end
|
||||||
|
|
||||||
function replace_ingredient(recipe, old, new)
|
function replace_ingredient(recipe, old, new)
|
||||||
if recipe ~= nil and recipe.ingredients ~= nil then
|
if recipe ~= nil and recipe.ingredients ~= nil then
|
||||||
|
for i, existing in pairs(recipe.ingredients) do
|
||||||
|
if existing[1] == new or existing.name == new then
|
||||||
|
log("Not adding "..new.." -- duplicate")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
for i, ingredient in pairs(recipe.ingredients) do
|
for i, ingredient in pairs(recipe.ingredients) do
|
||||||
if ingredient.name == old then ingredient.name = new end
|
if ingredient.name == old then ingredient.name = new end
|
||||||
if ingredient[1] == old then ingredient[1] = new end
|
if ingredient[1] == old then ingredient[1] = new end
|
||||||
|
|
@ -170,6 +182,12 @@ end
|
||||||
|
|
||||||
function replace_some_ingredient(recipe, old, old_amount, new, new_amount)
|
function replace_some_ingredient(recipe, old, old_amount, new, new_amount)
|
||||||
if recipe ~= nil and recipe.ingredients ~= nil then
|
if recipe ~= nil and recipe.ingredients ~= nil then
|
||||||
|
for i, existing in pairs(recipe.ingredients) do
|
||||||
|
if existing[1] == new or existing.name == new then
|
||||||
|
log("Not adding "..new.." -- duplicate")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
for i, ingredient in pairs(recipe.ingredients) do
|
for i, ingredient in pairs(recipe.ingredients) do
|
||||||
-- For final fixes
|
-- For final fixes
|
||||||
if ingredient.name == old then
|
if ingredient.name == old then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue