Skip to content

Commit

Permalink
Update to 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ZwerOxotnik committed Oct 22, 2024
1 parent ce92d86 commit fae5c1d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 0.1.2
Date: 2024-10-22
Bugfixes:
- Fixed crash on removing protection
---------------------------------------------------------------------------------------------------
Version: 0.1.1
Date: 2024-10-22
Bugfixes:
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "protected_teams",
"version": "0.1.1",
"version": "0.1.2",
"factorio_version": "2.0",
"title": "Protected teams [extension for EasyAPI][PRE-ALPHA]",
"author": "ZwerOxotnik",
Expand Down
24 changes: 15 additions & 9 deletions scenarios/protected_teams/protected_teams.lua
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,10 @@ function destroy_team_base_rendering(force_index)
local id = rendering_ids[i]
if id == nil then
break
elseif get_render_object_by_id(id) then
rendering.destroy(id)
end
local render_object = get_render_object_by_id(id)
if render_object.valid then
render_object.destroy()
end
end
end
Expand Down Expand Up @@ -411,8 +413,10 @@ function disable_protection(force_index, is_forced)
local id = rendering_ids[i]
if id == nil then
break
elseif get_render_object_by_id(id) then
rendering.destroy(id)
end
local render_object = get_render_object_by_id(id)
if render_object.valid then
render_object.destroy()
end
end
end
Expand Down Expand Up @@ -441,8 +445,10 @@ function enable_protection(force_index, duration_in_ticks)
local id = rendering_ids[i]
if id == nil then
break
elseif get_render_object_by_id(id) then
rendering.destroy(id)
end
local render_object = get_render_object_by_id(id)
if render_object.valid then
render_object.destroy()
end
end

Expand Down Expand Up @@ -865,9 +871,9 @@ function expand_protections()
break
end

local object = get_render_object_by_id(id)
if object.valid then
object.radius = radius_protection
local render_object = get_render_object_by_id(id)
if render_object.valid then
render_object.radius = radius_protection
end
end
::continue::
Expand Down

0 comments on commit fae5c1d

Please sign in to comment.