From 4b8d1b12e51d4815d40641ea429f9296aeeac9ef Mon Sep 17 00:00:00 2001 From: Aaron Suen Date: Fri, 26 Jun 2020 18:23:44 -0400 Subject: [PATCH] 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. --- docs/issues-code.txt | 7 +++++++ mods/nc_api_active/playerstep.lua | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/issues-code.txt b/docs/issues-code.txt index 813c700e..c8a26a7f 100644 --- a/docs/issues-code.txt +++ b/docs/issues-code.txt @@ -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. diff --git a/mods/nc_api_active/playerstep.lua b/mods/nc_api_active/playerstep.lua index 468626a3..1d4cee9b 100644 --- a/mods/nc_api_active/playerstep.lua +++ b/mods/nc_api_active/playerstep.lua @@ -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