From ca8f6d5c0fbd8054a8eae3c06757032b3eb35d78 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 10 May 2007 04:31:31 +0000 Subject: [PATCH] fix level accumulation --- pandatool/src/pstatserver/pStatView.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandatool/src/pstatserver/pStatView.cxx b/pandatool/src/pstatserver/pStatView.cxx index db76ae1acd..2441ed4f4d 100644 --- a/pandatool/src/pstatserver/pStatView.cxx +++ b/pandatool/src/pstatserver/pStatView.cxx @@ -471,7 +471,8 @@ update_level_data(const PStatFrameData &frame_data) { int collector_index = (*gi).first; float value = (*gi).second; - // Walk up to the top. + // Walk up to the top, but stop when we find a parent with actual + // data. while (collector_index != 0 && collector_index != _constraint) { const PStatCollectorDef &def = _client_data->get_collector_def(collector_index); @@ -480,8 +481,8 @@ update_level_data(const PStatFrameData &frame_data) { if (pi != alone_values.end()) { // The parent has data; subtract it. (*pi).second -= value; + break; } - collector_index = parent_index; } }