Skip to content

Commit ded9ea8

Browse files
sfan5MoNTE48
authored andcommitted
Use worldedit.keep_loaded consistently
1 parent 5c6cabf commit ded9ea8

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

worldedit_commands/mark.lua

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ worldedit.mark_pos1 = function(name, region_too)
1313
worldedit.marker1[name] = nil
1414
end
1515
if pos1 ~= nil then
16-
--make area stay loaded
17-
local manip = minetest.get_voxel_manip()
18-
manip:read_from_map(pos1, pos1)
16+
worldedit.keep_loaded(pos1, pos1)
1917

2018
--add marker
2119
worldedit.marker1[name] = minetest.add_entity(pos1, "worldedit:pos1", init_sentinel)
@@ -37,9 +35,7 @@ worldedit.mark_pos2 = function(name, region_too)
3735
worldedit.marker2[name] = nil
3836
end
3937
if pos2 ~= nil then
40-
--make area stay loaded
41-
local manip = minetest.get_voxel_manip()
42-
manip:read_from_map(pos2, pos2)
38+
worldedit.keep_loaded(pos2, pos2)
4339

4440
--add marker
4541
worldedit.marker2[name] = minetest.add_entity(pos2, "worldedit:pos2", init_sentinel)
@@ -77,9 +73,8 @@ worldedit.mark_region = function(name)
7773
local thickness = 0.2
7874
local sizex, sizey, sizez = (1 + pos2.x - pos1.x) / 2, (1 + pos2.y - pos1.y) / 2, (1 + pos2.z - pos1.z) / 2
7975

80-
--make area stay loaded
81-
local manip = minetest.get_voxel_manip()
82-
manip:read_from_map(pos1, pos2)
76+
-- TODO maybe we could skip this actually?
77+
worldedit.keep_loaded(pos1, pos2)
8378

8479
local markers = {}
8580

0 commit comments

Comments
 (0)