Skip to content

Commit 714a8ce

Browse files
committedAug 4, 2013
Freeze-melt adjust
1 parent be4670f commit 714a8ce

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎src/content_abm.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,12 @@ class LiquidFreeze : public ActiveBlockModifier {
255255

256256
float heat = map->getHeat(env, p);
257257
//heater = rare
258-
if (heat <= -1 && (heat <= -50 || ((myrand_range(-50, heat)) <= -30))) {
258+
content_t c = map->getNodeNoEx(p - v3s16(0, -1, 0 )).getContent(); // top
259+
//more chance to freeze if air at top
260+
if (heat <= -1 && (heat <= -50 || (myrand_range(-50, heat) <= (c == CONTENT_AIR ? -10 : -40)))) {
259261
content_t c_self = n.getContent();
260262
// making freeze not annoying, do not freeze random blocks in center of ocean
261263
// todo: any block not water (dont freeze _source near _flowing)
262-
content_t c;
263264
bool allow = heat < -40;
264265
// todo: make for(...)
265266
if (!allow) {
@@ -315,7 +316,8 @@ class LiquidMeltWeather : public ActiveBlockModifier {
315316
INodeDefManager *ndef = env->getGameDef()->ndef();
316317

317318
float heat = map->getHeat(env, p);
318-
if (heat >= 1 && (heat >= 40 || ((myrand_range(heat, 40)) >= 20))) {
319+
content_t c = map->getNodeNoEx(p - v3s16(0, -1, 0 )).getContent(); // top
320+
if (heat >= 1 && (heat >= 40 || ((myrand_range(heat, 40)) >= (c == CONTENT_AIR ? 10 : 20)))) {
319321
n.freezeMelt(ndef);
320322
map->addNodeWithEvent(p, n);
321323
env->getScriptIface()->node_falling_update(p);

0 commit comments

Comments
 (0)
Please sign in to comment.