* Add a check for the special case of a commander playing in multiplayer (it needs less kills to achieve ranks then); I missed this when replaceing the specialized version of getDroidLevel for commanders
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1831 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
cc5de7ec37
commit
2adc6e3515
|
@ -169,6 +169,11 @@ void cmdDroidMultiExpBoost(BOOL bDoit)
|
|||
bMultiExpBoost = bDoit;
|
||||
}
|
||||
|
||||
BOOL cmdGetDroidMultiExpBoost()
|
||||
{
|
||||
return bMultiExpBoost;
|
||||
}
|
||||
|
||||
// get the maximum group size for a command droid
|
||||
unsigned int cmdDroidMaxGroup(DROID *psCommander)
|
||||
{
|
||||
|
|
|
@ -77,6 +77,8 @@ extern void cmdSelectSubDroids(DROID *psDroid);
|
|||
// note that commander experience should be increased
|
||||
extern void cmdDroidMultiExpBoost(BOOL bDoit);
|
||||
|
||||
// check whether commander experience should be increased
|
||||
extern BOOL cmdGetDroidMultiExpBoost(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -4253,15 +4253,22 @@ UDWORD getDroidLevel(DROID *psDroid)
|
|||
static const unsigned int lastRank = sizeof(arrRank) / sizeof(struct rankMap);
|
||||
bool isCommander = (psDroid->droidType == DROID_COMMAND ||
|
||||
psDroid->droidType == DROID_SENSOR) ? true : false;
|
||||
unsigned int numKills = psDroid->numKills;
|
||||
unsigned int i;
|
||||
|
||||
// Commanders don't need as much kills for ranks in multiplayer
|
||||
if (isCommander && cmdGetDroidMultiExpBoost())
|
||||
{
|
||||
numKills *= 2;
|
||||
}
|
||||
|
||||
// Search through the array of ranks until one is found
|
||||
// which requires more kills than the droid has.
|
||||
// Then fall back to the previous rank.
|
||||
for (i = 1; i != lastRank; ++i)
|
||||
{
|
||||
unsigned int requiredKills = isCommander ? arrRank[i].commanderKills : arrRank[i].kills;
|
||||
if (psDroid->numKills < requiredKills)
|
||||
if (numKills < requiredKills)
|
||||
{
|
||||
return i - 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue