From 38445238820da20d86e864de54dc4c1f9a22febd Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 17 Mar 2013 13:24:57 +0000 Subject: ProbabDistrib: fixed definition string parsing with nonzero start git-svn-id: http://mc-server.googlecode.com/svn/trunk@1281 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/ProbabDistrib.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/ProbabDistrib.cpp') diff --git a/source/ProbabDistrib.cpp b/source/ProbabDistrib.cpp index fbc9f9428..98c18b8e1 100644 --- a/source/ProbabDistrib.cpp +++ b/source/ProbabDistrib.cpp @@ -31,10 +31,11 @@ void cProbabDistrib::SetPoints(const cProbabDistrib::cPoints & a_Points) m_Cumulative.reserve(a_Points.size() + 1); int ProbSum = 0; int LastProb = 0; - int LastValue = 0; + int LastValue = -1; if (a_Points[0].m_Value != 0) { m_Cumulative.push_back(cPoint(0, 0)); // Always push in the [0, 0] point for easier search algorithm bounds + LastValue = 0; } for (cPoints::const_iterator itr = a_Points.begin(), end = a_Points.end(); itr != end; ++itr) { -- cgit v1.2.3