Skip to content

Commit

Permalink
Adjusted RipeMeta for off by one error (cuberite#3691)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbhicks authored and worktycho committed May 6, 2017
1 parent 05c3e8b commit dffbf0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Blocks/BlockCrops.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class cBlockCropsHandler :
cFastRandom rand;

// If not fully grown, drop the "seed" of whatever is growing:
if (a_Meta < RipeMeta)
if (a_Meta < (RipeMeta - 1))
{
switch (m_BlockType)
{
Expand Down Expand Up @@ -97,7 +97,7 @@ class cBlockCropsHandler :

// If there is still room to grow and the plant can grow, then grow.
// Otherwise if the plant needs to die, then dig it up
if ((Meta < RipeMeta) && (Action == paGrowth))
if ((Meta < (RipeMeta - 1)) && (Action == paGrowth))
{
a_Chunk.FastSetBlock(a_RelX, a_RelY, a_RelZ, m_BlockType, ++Meta);
}
Expand Down

0 comments on commit dffbf0b

Please sign in to comment.