From 60c9994e29c6468a8dd56a9025f5bfade7aaa835 Mon Sep 17 00:00:00 2001 From: hiker Date: Tue, 19 Jun 2018 18:27:33 +1000 Subject: [PATCH] Fixed documentation and typo, thanks to Alayan. --- data/powerup.xml | 7 +++++-- src/items/powerup_manager.cpp | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) mode change 100644 => 100755 src/items/powerup_manager.cpp diff --git a/data/powerup.xml b/data/powerup.xml index 84cf93c4b..e66f27bd1 100644 --- a/data/powerup.xml +++ b/data/powerup.xml @@ -94,7 +94,8 @@ If there is a WeightsData object for the same kart number, it is copied, otherwise an interpolated WeightsData object is created from the two WeightsData objects that are closest to the current - number of karts. + number of karts. If there is only one WeightsData for the race + mode, it is used for any number of karts. Each Weights entry itself can contain one or more weight tags: The first entry is for the kart with rank 1, the last weight entry for the last kart. The remaining entries are evenly distributed @@ -133,8 +134,10 @@ there are more karts. --> - + diff --git a/src/items/powerup_manager.cpp b/src/items/powerup_manager.cpp old mode 100644 new mode 100755 index 45430cc87..c2303a6e7 --- a/src/items/powerup_manager.cpp +++ b/src/items/powerup_manager.cpp @@ -522,7 +522,7 @@ void PowerupManager::computeWeightsForRace(int num_karts) { int n = wd[i]->getNumKarts(); if ( ( n < wd[prev_index]->getNumKarts() && - wd[next_index]->getNumKarts() > num_karts) || + wd[prev_index]->getNumKarts() > num_karts) || ( n > wd[prev_index]->getNumKarts() && n <= num_karts ) ) { prev_index = i; @@ -592,7 +592,7 @@ PowerupManager::PowerupType PowerupManager::getRandomPowerup(unsigned int pos, void PowerupManager::unitTesting() { // Test 1: Test all possible random numbers for tutorial, and - // make sure that always a cake is picked. + // make sure that always three bowling balls are picked. // ---------------------------------------------------------- race_manager->setMinorMode(RaceManager::MINOR_MODE_TUTORIAL); powerup_manager->computeWeightsForRace(1);