summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubenwardy <rubenwardy@gmail.com>2014-08-27 17:15:50 +0100
committerrubenwardy <rubenwardy@gmail.com>2014-08-27 17:15:50 +0100
commit25a405df345f7c596cf969422427a0f22d413d98 (patch)
tree7fa0c07623f05b475c82d248e1d0a59828be7a13
parent728742a9696395d09a4958b76d2ec8579ac3ab82 (diff)
Fix bug
-rw-r--r--init.lua11
1 files changed, 2 insertions, 9 deletions
diff --git a/init.lua b/init.lua
index 2a7161f..ff2a2d0 100644
--- a/init.lua
+++ b/init.lua
@@ -39,21 +39,13 @@ function ForceloadManager(filetoopen, hide_file_errors)
unload = function(self, pos)
for i = 1, #self._blocks do
if vector.equals(pos, self._blocks[i]) then
- minetest.forceload_block(pos)
+ minetest.forceload_free_block(pos)
table.remove(self._blocks, i)
return true
end
end
return false
end,
- iter = function(self, func)
- for i = 1, #self._blocks do
- if func(i, self._blocks[i]) == true then
- table.remove(self._blocks, i)
- i = i - 1
- end
- end
- end,
save = function(self, filename)
local file = io.open(filename, "w")
if file then
@@ -104,6 +96,7 @@ function ForceloadManager(filetoopen, hide_file_errors)
local i = 1
while i <= #self._blocks do
if self._blocks[i].remove then
+ minetest.forceload_free_block(self._blocks[i])
table.remove(self._blocks, i)
else
i = i + 1