From 2ca96ecb7545da56025c4d325e59022c5676be10 Mon Sep 17 00:00:00 2001 From: darkrose Date: Sun, 12 May 2013 06:27:18 +1000 Subject: [PATCH] add cactus to farming --- src/environment.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/environment.cpp b/src/environment.cpp index 219c5ca..b8d3ee7 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -1031,6 +1031,7 @@ void ServerEnvironment::step(float dtime) if ( testnode.getContent() == CONTENT_JUNGLEGRASS || testnode.getContent() == CONTENT_PAPYRUS + || testnode.getContent() == CONTENT_CACTUS ) { found = true; type = testnode.getContent(); @@ -1043,13 +1044,17 @@ void ServerEnvironment::step(float dtime) case CONTENT_PAPYRUS: max_growth = 5; type = CONTENT_PAPYRUS; + case CONTENT_CACTUS: + max_growth = 4; + type = CONTENT_CACTUS; case CONTENT_JUNGLEGRASS: for(s16 y=2; !found && y<=max_growth; y++) { test_p = temp_p + v3s16(0,y,0); testnode = m_map->getNodeNoEx(test_p); - if (testnode.getContent() == CONTENT_AIR) { - found = true; + if (testnode.getContent() != type) { + if (testnode.getContent() == CONTENT_AIR) + found = true; break; } }