From 36f7084e3fb4193676b14f302d0f961f2102e4ba Mon Sep 17 00:00:00 2001 From: "admin@omencraft.com" Date: Sun, 6 Nov 2011 09:23:20 +0000 Subject: Patch with diff file created by Sebi (implemented some stuff like lava physics, drops are deleted when in lava, water is now slower, lava gives actual damage etc.). Pistons now work mostly as they should. They do not yet show the motion animation and do not emit sound. They do extend, push, and retract as they should though. Right now the only way to activate a piston is to light redstone wire adjacent to it with a redstone torch. git-svn-id: http://mc-server.googlecode.com/svn/trunk@67 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunk.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source/cChunk.cpp') diff --git a/source/cChunk.cpp b/source/cChunk.cpp index e9fd739eb..a8a579e96 100644 --- a/source/cChunk.cpp +++ b/source/cChunk.cpp @@ -337,7 +337,7 @@ void cChunk::Tick(float a_Dt) case E_BLOCK_GRASS: { char AboveBlock = GetBlock( Index+1 ); - if (!( (AboveBlock == 0) || (g_BlockOneHitDig[AboveBlock]) ) ) //changed to not allow grass if any one hit object is on top + if (!( (AboveBlock == 0) || (g_BlockOneHitDig[AboveBlock]) || (g_BlockTransparent[AboveBlock]) ) ) //changed to not allow grass if any one hit object is on top { FastSetBlock( m_BlockTickX, m_BlockTickY, m_BlockTickZ, E_BLOCK_DIRT, GetLight( m_BlockMeta, Index ) ); } @@ -687,13 +687,13 @@ void cChunk::SpreadLight(char* a_LightBuffer) float GetNoise( float x, float y, cNoise & a_Noise ) { - float oct1 = a_Noise.SSE_CubicNoise2D( x*cGenSettings::HeightFreq1, y*cGenSettings::HeightFreq1 )*cGenSettings::HeightAmp1; - float oct2 = a_Noise.SSE_CubicNoise2D( x*cGenSettings::HeightFreq2, y*cGenSettings::HeightFreq2 )*cGenSettings::HeightAmp2; - float oct3 = a_Noise.SSE_CubicNoise2D( x*cGenSettings::HeightFreq3, y*cGenSettings::HeightFreq3 )*cGenSettings::HeightAmp3; + float oct1 = a_Noise.CubicNoise2D( x*cGenSettings::HeightFreq1, y*cGenSettings::HeightFreq1 )*cGenSettings::HeightAmp1; + float oct2 = a_Noise.CubicNoise2D( x*cGenSettings::HeightFreq2, y*cGenSettings::HeightFreq2 )*cGenSettings::HeightAmp2; + float oct3 = a_Noise.CubicNoise2D( x*cGenSettings::HeightFreq3, y*cGenSettings::HeightFreq3 )*cGenSettings::HeightAmp3; - float height = a_Noise.SSE_CubicNoise2D( x*0.1f, y*0.1f )*2; + float height = a_Noise.CubicNoise2D( x*0.1f, y*0.1f )*2; - float flatness = ((a_Noise.SSE_CubicNoise2D( x*0.5f, y*0.5f ) + 1.f ) * 0.5f) * 1.1f; // 0 ... 1.5 + float flatness = ((a_Noise.CubicNoise2D( x*0.5f, y*0.5f ) + 1.f ) * 0.5f) * 1.1f; // 0 ... 1.5 flatness *= flatness * flatness; return (oct1 + oct2 + oct3) * flatness + height; @@ -845,8 +845,8 @@ void cChunk::GenerateTerrain() // int yy = TopY; int zz = z + m_PosZ*16; - float val1 = m_Noise.SSE_CubicNoise2D( xx*0.1f, zz*0.1f ); - float val2 = m_Noise.SSE_CubicNoise2D( xx*0.01f, zz*0.01f ); + float val1 = m_Noise.CubicNoise2D( xx*0.1f, zz*0.1f ); + float val2 = m_Noise.CubicNoise2D( xx*0.01f, zz*0.01f ); if( m_BlockType[index] == SandID ) { if( (val1 + val2 > 0.f) && (rand()%128) > 124 && m_BlockType[index] == E_BLOCK_SAND ) @@ -861,8 +861,8 @@ void cChunk::GenerateTerrain() } else if( m_BlockType[index] == GrassID ) { - float val3 = m_Noise.SSE_CubicNoise2D( xx*0.01f+10, zz*0.01f+10 ); - float val4 = m_Noise.SSE_CubicNoise2D( xx*0.05f+20, zz*0.05f+20 ); + float val3 = m_Noise.CubicNoise2D( xx*0.01f+10, zz*0.01f+10 ); + float val4 = m_Noise.CubicNoise2D( xx*0.05f+20, zz*0.05f+20 ); if( val1 + val2 > 0.2f && (rand()%128) > 124 ) m_World->GrowTree( xx, TopY, zz ); else if( val3 > 0.2f && (rand()%128) > 124 ) -- cgit v1.2.3