diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-05-22 17:00:09 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-05-22 17:00:09 +0300 |
commit | 0af53115384cda1d96337b39c4205cb7a970c069 (patch) | |
tree | e4fa369ece509e685e2ff719b9228492bffc93d8 /src/client.cpp | |
parent | af7d50e91091b7bec74d94ad61c948062d4c1aab (diff) | |
download | minetest-0af53115384cda1d96337b39c4205cb7a970c069.tar.gz minetest-0af53115384cda1d96337b39c4205cb7a970c069.tar.bz2 minetest-0af53115384cda1d96337b39c4205cb7a970c069.zip |
Preliminary "active block" stuff + set up test code to grow grass.
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/client.cpp b/src/client.cpp index e2cda97c1..c85d6e9e2 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1193,31 +1193,23 @@ void Client::ProcessData(u8 *data, u32 datasize, u16 sender_peer_id) if(datasize < 4) return; - u16 time = readU16(&data[2]); - time = time % 24000; - m_time_of_day = time; - //dstream<<"Client: time="<<time<<std::endl; + u16 time_of_day = readU16(&data[2]); + time_of_day = time_of_day % 24000; + //dstream<<"Client: time_of_day="<<time_of_day<<std::endl; /* - Day/night - time_of_day: 0 = midnight 12000 = midday */ { - u32 dr = time_to_daynight_ratio(m_time_of_day); + m_env.setTimeOfDay(time_of_day); + + u32 dr = m_env.getDayNightRatio(); - dstream<<"Client: time_of_day="<<m_time_of_day + dstream<<"Client: time_of_day="<<time_of_day <<", dr="<<dr <<std::endl; - - if(dr != m_env.getDayNightRatio()) - { - dout_client<<DTIME<<"Client: changing day-night ratio"<<std::endl; - m_env.setDayNightRatio(dr); - m_env.expireMeshes(true); - } } } |