Fixed documentation and typo, thanks to Alayan.

This commit is contained in:
hiker 2018-06-19 18:27:33 +10:00
parent 714665f444
commit 60c9994e29
2 changed files with 7 additions and 4 deletions

View File

@ -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. -->
<race-weight-list>
<!-- The entry for '1' karts is special and means 'first kart' -->
<weights num-karts="1">
<!-- The entry for '1' kart lists more than a single weight
because the others are used for interpolation when
there are two karts or more. -->
<!-- bubble cake bowl zipper plunger switch swattr rubber para anvil -->
<weight single ="28 0 60 20 45 15 32 0 0 0"
multi =" 0 0 0 0 0 0 0 0 0 0" />

4
src/items/powerup_manager.cpp Normal file → Executable file
View File

@ -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);