summaryrefslogtreecommitdiff
path: root/src/content_abm.cpp
diff options
context:
space:
mode:
authorproller <proller@github.com>2013-08-04 23:07:30 +0400
committerproller <proller@github.com>2013-08-04 23:31:01 +0400
commit714a8cef38ed46ddd6ef7c2689c93db2704969eb (patch)
tree8466f7556f831fa8f2c9ca151bd8a9ecc0a90c36 /src/content_abm.cpp
parentbe4670fecfceabd6760153e9a5b4f9868614e573 (diff)
downloadminetest-714a8cef38ed46ddd6ef7c2689c93db2704969eb.tar.gz
minetest-714a8cef38ed46ddd6ef7c2689c93db2704969eb.tar.bz2
minetest-714a8cef38ed46ddd6ef7c2689c93db2704969eb.zip
Freeze-melt adjust
Diffstat (limited to 'src/content_abm.cpp')
-rw-r--r--src/content_abm.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/content_abm.cpp b/src/content_abm.cpp
index 2501a3a32..57e4637d4 100644
--- a/src/content_abm.cpp
+++ b/src/content_abm.cpp
@@ -255,11 +255,12 @@ class LiquidFreeze : public ActiveBlockModifier {
float heat = map->getHeat(env, p);
//heater = rare
- if (heat <= -1 && (heat <= -50 || ((myrand_range(-50, heat)) <= -30))) {
+ content_t c = map->getNodeNoEx(p - v3s16(0, -1, 0 )).getContent(); // top
+ //more chance to freeze if air at top
+ if (heat <= -1 && (heat <= -50 || (myrand_range(-50, heat) <= (c == CONTENT_AIR ? -10 : -40)))) {
content_t c_self = n.getContent();
// making freeze not annoying, do not freeze random blocks in center of ocean
// todo: any block not water (dont freeze _source near _flowing)
- content_t c;
bool allow = heat < -40;
// todo: make for(...)
if (!allow) {
@@ -315,7 +316,8 @@ class LiquidMeltWeather : public ActiveBlockModifier {
INodeDefManager *ndef = env->getGameDef()->ndef();
float heat = map->getHeat(env, p);
- if (heat >= 1 && (heat >= 40 || ((myrand_range(heat, 40)) >= 20))) {
+ content_t c = map->getNodeNoEx(p - v3s16(0, -1, 0 )).getContent(); // top
+ if (heat >= 1 && (heat >= 40 || ((myrand_range(heat, 40)) >= (c == CONTENT_AIR ? 10 : 20)))) {
n.freezeMelt(ndef);
map->addNodeWithEvent(p, n);
env->getScriptIface()->node_falling_update(p);