Rearrange a couple functions for readability
This commit is contained in:
parent
a3394b3759
commit
181b9a71cd
|
@ -58,18 +58,6 @@ function energyCraftingModifier(entity)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function getSuctionRate(entity)
|
|
||||||
if not entity.is_crafting() and getSpaceForPollution(entity) == 0 then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return getBasePurificationRate(entity) * entity.crafting_speed * energyCraftingModifier(entity)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function getAbsorptionRate(entity)
|
|
||||||
return math.min(getSpaceForPollution(entity), getSuctionRate(entity))
|
|
||||||
end
|
|
||||||
|
|
||||||
function pollutionInPollutedWater(amount)
|
function pollutionInPollutedWater(amount)
|
||||||
return amount * 6 / 10
|
return amount * 6 / 10
|
||||||
end
|
end
|
||||||
|
@ -87,6 +75,18 @@ function getSpaceForPollution(entity)
|
||||||
return capacity - pollution
|
return capacity - pollution
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function getSuctionRate(entity)
|
||||||
|
if not entity.is_crafting() and getSpaceForPollution(entity) == 0 then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return getBasePurificationRate(entity) * entity.crafting_speed * energyCraftingModifier(entity)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function getAbsorptionRate(entity)
|
||||||
|
return math.min(getSpaceForPollution(entity), getSuctionRate(entity))
|
||||||
|
end
|
||||||
|
|
||||||
function inRadius(filter, radius)
|
function inRadius(filter, radius)
|
||||||
if filter.name == "air-filter-machine-1" then
|
if filter.name == "air-filter-machine-1" then
|
||||||
return radius <= 0
|
return radius <= 0
|
||||||
|
|
Reference in New Issue