1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-02-15 13:53:13 +02:00

Fixed evo floating text bug

This commit is contained in:
Jayefuu 2021-02-26 15:39:18 +00:00
parent 5bf4ab908c
commit bd923951ed

View File

@ -279,8 +279,8 @@ local function do_evolution(entity, entity_name, entity_force)
local old = entity_force.evolution_factor
local extra = (1 - old) * factor
local new = old + extra
entity_force.evolution_factor = math.min(new,1)
if new < 1 then
entity_force.evolution_factor = new
local position = entity.position
entity.surface.create_entity{name="flying-text", position = {position.x - 1, position.y}, text = "+" .. round(extra*100,2) .. "% evo", color = Color.plum}
end