Fix missing opt. dependency and offset cycle

This commit is contained in:
Till Affeldt 2020-04-11 06:47:21 +02:00
parent 05fd6a98d5
commit e07af4cdd2
3 changed files with 6 additions and 9 deletions

View File

@ -1,5 +1,5 @@
# Moon phases
Make your sky change follow a cycle
Make your moon follow a realistic cycle
__Important__: This mod requires at least Minetest 5.2.0 for the game's new sky API.
Make sure you have the latest version installed or [update your game](https://www.minetest.net/downloads/).
@ -33,6 +33,6 @@ All source code is licensed under GNU LESSER GENERAL PUBLIC LICENSE version 3.
You can find a copy of that license in the repository.
## Media
All included moon textures are resized versions of graphics from *NASA's Scientific Visualization Studio*.
These images are part of the Public Domain.
All included moon textures are resized versions of graphics from *NASA's Scientific Visualization Studio* by [Ernie Wright](https://svs.gsfc.nasa.gov/cgi-bin/search.cgi?person=1059).
These images are part of the Public Domain as CC-BY-SA 3.0.
You can access the entire (high resolution) album on [their website](https://svs.gsfc.nasa.gov/4769#28564). See [NASA's media guidelines](https://www.nasa.gov/multimedia/guidelines/index.html) for more information on licensing.

View File

@ -1 +1,2 @@
skylayer?
skylayer?
datastorage?

View File

@ -18,9 +18,6 @@ local function get_cycle_config()
end
local PHASE_LENGTH = get_cycle_config()
if state.day >= PHASE_LENGTH then
state.day = 1
end
local function set_texture(player, texture)
local sl = {}
@ -46,8 +43,7 @@ local function handle_time_progression()
local time = minetest.get_timeofday()
if time >= 0.5 and state.change_time then
state.day = state.day + 1
if state.day == PHASE_LENGTH then
state.day = 1
if state.day % PHASE_LENGTH == 0 then
state.phase = (state.phase % 8) + 1
state.change_time = false
update_textures()