summaryrefslogtreecommitdiff
path: root/src/mapblock.cpp
diff options
context:
space:
mode:
authorproller <proller@github.com>2013-07-27 22:34:30 +0400
committerproller <proller@github.com>2013-07-27 23:21:48 +0400
commit3aedfac9685c2d9ae8bac5a5b7e72e527f22c08d (patch)
treed1f9067040acb0b5dad42a2ae8935b91124a36d3 /src/mapblock.cpp
parente65d8ad6553d7ae0acf63b43e9818059088a00b6 (diff)
downloadminetest-3aedfac9685c2d9ae8bac5a5b7e72e527f22c08d.tar.gz
minetest-3aedfac9685c2d9ae8bac5a5b7e72e527f22c08d.tar.bz2
minetest-3aedfac9685c2d9ae8bac5a5b7e72e527f22c08d.zip
Weather support
Diffstat (limited to 'src/mapblock.cpp')
-rw-r--r--src/mapblock.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/mapblock.cpp b/src/mapblock.cpp
index dd95ab77f..56d4416a4 100644
--- a/src/mapblock.cpp
+++ b/src/mapblock.cpp
@@ -58,7 +58,11 @@ MapBlock::MapBlock(Map *parent, v3s16 pos, IGameDef *gamedef, bool dummy):
m_timestamp(BLOCK_TIMESTAMP_UNDEFINED),
m_disk_timestamp(BLOCK_TIMESTAMP_UNDEFINED),
m_usage_timer(0),
- m_refcount(0)
+ m_refcount(0),
+ heat_time(0),
+ heat(0),
+ humidity_time(0),
+ humidity(0)
{
data = NULL;
if(dummy == false)
@@ -632,6 +636,11 @@ void MapBlock::serialize(std::ostream &os, u8 version, bool disk)
// Node timers
m_node_timers.serialize(os, version);
}
+ } else {
+ if(version >= 26){
+ writeF1000(os, heat);
+ writeF1000(os, humidity);
+ }
}
}
@@ -734,6 +743,11 @@ void MapBlock::deSerialize(std::istream &is, u8 version, bool disk)
<<": Node timers (ver>=25)"<<std::endl);
m_node_timers.deSerialize(is, version);
}
+ } else {
+ if(version >= 26){
+ heat = readF1000(is);
+ humidity = readF1000(is);
+ }
}
TRACESTREAM(<<"MapBlock::deSerialize "<<PP(getPos())