Fix B3D reading on Win & add todo

master
Lars Mueller 2022-05-12 14:24:48 +02:00
parent de2984e70a
commit f63e3577f7
1 changed files with 3 additions and 2 deletions

View File

@ -45,7 +45,7 @@ local b3d_triangle_sets = setmetatable({}, {__index = function(self, filename)
return
end
local path = assert(media_paths[filename], filename)
local model = io.open(path, "r")
local model = io.open(path, "rb")
local character = assert(modlib.b3d.read(model))
assert(not model:read(1))
model:close()
@ -288,6 +288,7 @@ local function spawn_ghosts()
if nights_passed >= conf.forget_duration_nights then
data:set(data.root.players[name], ghostname, nil)
elseif is_halloween or (math.random() <= conf.spawn_chance * conf.chance_reduction_per_night^nights_passed) then
-- TODO nothing happens the very first night? 3d_armor support doesn't seem to work?
-- Spread ghost spawning out across 10 seconds
-- TODO make this configurable
modlib.minetest.after(math.random() * 10, function()
@ -343,4 +344,4 @@ minetest.register_on_player_hpchange(function(victim, hp_change, reason)
end)
-- Export API as a global variable
ghosts = {spawn_ghost = spawn_ghost}
ghosts = {spawn_ghost = spawn_ghost}