diff options
author | proller <proller@github.com> | 2013-09-18 01:37:47 +0400 |
---|---|---|
committer | proller <proller@github.com> | 2013-09-18 01:37:47 +0400 |
commit | f7ee5da4c115231df3f4897db04fd308749efe55 (patch) | |
tree | 009d732be1566ba7c7ae26878cc81454ba176078 /src | |
parent | c0398224ef60b73067351d3e8f7a6e0d1ff7df72 (diff) | |
download | minetest-f7ee5da4c115231df3f4897db04fd308749efe55.tar.gz minetest-f7ee5da4c115231df3f4897db04fd308749efe55.tar.bz2 minetest-f7ee5da4c115231df3f4897db04fd308749efe55.zip |
Fix null dereference in weather update functions
Diffstat (limited to 'src')
-rw-r--r-- | src/map.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/map.cpp b/src/map.cpp index 55b758055..e8115d39b 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -3935,8 +3935,10 @@ s16 ServerMap::updateBlockHeat(ServerEnvironment *env, v3s16 p, MapBlock *block) f32 heat = m_emerge->biomedef->calcBlockHeat(p, m_seed, env->getTimeOfDayF(), gametime * env->getTimeOfDaySpeed()); - block->heat = heat; - block->weather_update_time = gametime; + if(block) { + block->heat = heat; + block->weather_update_time = gametime; + } return heat; } @@ -3954,8 +3956,10 @@ s16 ServerMap::updateBlockHumidity(ServerEnvironment *env, v3s16 p, MapBlock *bl f32 humidity = m_emerge->biomedef->calcBlockHumidity(p, m_seed, env->getTimeOfDayF(), gametime * env->getTimeOfDaySpeed()); - block->humidity = humidity; - block->weather_update_time = gametime; + if(block) { + block->humidity = humidity; + block->weather_update_time = gametime; + } return humidity; } |