Fix a set_sky crash

We can't use push incremental changes to set_sky, we need to
push the whole sky definition each time.
This commit is contained in:
Aaron Suen 2020-06-26 18:23:44 -04:00
parent 775718256d
commit 4b8d1b12e5
2 changed files with 10 additions and 2 deletions

View File

@ -24,6 +24,13 @@ ISSUES-CODE: Issues related to code quality and APIs
- Break up hints into each individual mod.
- Add shortcuts for hint registrations, e.g. integrated with recipes.
- Transactional api ref localization
- For certain large computations, like an optic processing, it may be
worthwhile to capture some often-repeated functions like minetest.get_node
as locals.
- May need to test performance on a non-JIT build, where this is expected
to have a larger impact, since JIT probably optimizes the difference away.
- Continue to chisel away at ABM perf issues.
- Simplify or optimize existing ABMs
- Convert things to DNTs.

View File

@ -120,8 +120,9 @@ local function step_player(player, dtime)
if mismatch(data.animation, orig_anim) then
player:set_animation(unpack(data.animation))
end
local sky = setdelta(data.sky, orig_sky)
if sky then setsky(player, sky) end
if mismatch(data.sky, orig_sky) then
setsky(player, data.sky)
end
if mismatch(data.daynight, orig_daynight) then
player:override_day_night_ratio(data.daynight)
end