mirror of
https://github.com/Wyrrrd/Gun_Turret_Alerts.git
synced 2026-06-03 07:52:27 +02:00
Bugfix & style
- added initialization of turret index - removed unnecessary variable
This commit is contained in:
@@ -1,4 +1,9 @@
|
|||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
|
Version: 0.18.3
|
||||||
|
Date: 2020-03-21
|
||||||
|
Bugfixes:
|
||||||
|
- Added missing initialization of turret index
|
||||||
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 0.18.2
|
Version: 0.18.2
|
||||||
Date: 2020-03-20
|
Date: 2020-03-20
|
||||||
Changes:
|
Changes:
|
||||||
|
|||||||
+3
-3
@@ -4,9 +4,9 @@
|
|||||||
script.on_event({defines.events.on_tick}, function (event)
|
script.on_event({defines.events.on_tick}, function (event)
|
||||||
--Every minute the surface is rescanned for ammo-turret type entities. This is stored in the global table.
|
--Every minute the surface is rescanned for ammo-turret type entities. This is stored in the global table.
|
||||||
if event.tick%3600 == 0 or global.turret_entities == nil then
|
if event.tick%3600 == 0 or global.turret_entities == nil then
|
||||||
local planet = game.surfaces
|
global.turret_entities = {}
|
||||||
for index,_ in pairs(planet) do
|
for index,surface in pairs(game.surfaces) do
|
||||||
global.turret_entities[index] = planet[index].find_entities_filtered{type = "ammo-turret"}
|
global.turret_entities[index] = surface.find_entities_filtered{type = "ammo-turret"}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if event.tick%600 == 0 then
|
if event.tick%600 == 0 then
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Gun_Turret_Alerts",
|
"name": "Gun_Turret_Alerts",
|
||||||
"version": "0.18.2",
|
"version": "0.18.3",
|
||||||
"title": "Gun_Turret_Alerts",
|
"title": "Gun_Turret_Alerts",
|
||||||
"author": "Wyrrrd",
|
"author": "Wyrrrd",
|
||||||
"factorio_version": "0.18",
|
"factorio_version": "0.18",
|
||||||
|
|||||||
Reference in New Issue
Block a user