1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Weather support

This commit is contained in:
proller 2013-07-27 22:34:30 +04:00
parent e65d8ad655
commit 3aedfac968
23 changed files with 552 additions and 91 deletions

View file

@ -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())