OSHA Wind Power


Adds windmills for power. For best results keep spread and near water if possible

Content
2 years ago
0.17 - 1.1
1.77K
Power

b Crash on start

5 years ago
(updated 5 years ago)

Now I was too curious, so I installed the mod in my testing Factorio installation to have a look at it. On starting a new game as well as on loading an existing game, the mod crashes with an unrecoverable error:

The mod OSHA Wind Power caused a non-recoverable error.
Please report this error to the mod author.

Error while running event osha_wind_power::on_tick (ID 0)
__osha_wind_power__/scripts/windturbine.lua:13: 'for' limit must be a number
stack traceback:
    __osha_wind_power__/scripts/windturbine.lua:13: in function 'process_turbines'
    __osha_wind_power__/control.lua:42: in function <__osha_wind_power__/control.lua:41>

In the beginning, global.num_wind_turbines doesn't exist yet, so the local num_wind_turbines has the value nil, not 0. You can fix that by changing line 13 in scripts/windturbines.lua from

    if num_wind_turbines == 0 then return end

to

    if not num_wind_turbines or num_wind_turbines == 0 then return end
5 years ago

Thanks PI-C, I didn't notice that as I didn't start a fresh map. Bad unit testing on my part. I've fixed it and released an update!

This thread has been locked.