mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
Version set to 0.75c. Will be released as dev version.
HLP class for generating stats must not be local if used as template parameter.
This commit is contained in:
2
global.h
2
global.h
@ -20,7 +20,7 @@ typedef boost::int8_t si8; //signed int 8 bits (1 byte)
|
||||
#define THC
|
||||
#endif
|
||||
|
||||
#define NAME_VER ("VCMI 0.75b")
|
||||
#define NAME_VER ("VCMI 0.75c")
|
||||
extern std::string NAME; //full name
|
||||
extern std::string NAME_AFFIX; //client / server
|
||||
#define CONSOLE_LOGGING_LEVEL 5
|
||||
|
@ -3138,15 +3138,13 @@ bool CGameState::checkForStandardLoss( ui8 player ) const
|
||||
return !p.heroes.size() && !p.towns.size();
|
||||
}
|
||||
|
||||
void CGameState::obtainPlayersStats(SThievesGuildInfo & tgi, int level)
|
||||
struct statsHLP
|
||||
{
|
||||
struct HLP
|
||||
{
|
||||
typedef std::pair< ui8, si64 > TStat;
|
||||
//converts [<player's color, value>] to vec[place] -> platers
|
||||
static std::vector< std::list< ui8 > > getRank( std::vector<TStat> stats )
|
||||
{
|
||||
std::sort(stats.begin(), stats.end(), HLP());
|
||||
std::sort(stats.begin(), stats.end(), statsHLP());
|
||||
|
||||
//put first element
|
||||
std::vector< std::list<ui8> > ret;
|
||||
@ -3202,8 +3200,10 @@ void CGameState::obtainPlayersStats(SThievesGuildInfo & tgi, int level)
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void CGameState::obtainPlayersStats(SThievesGuildInfo & tgi, int level)
|
||||
{
|
||||
#define FILL_FIELD(FIELD, VAL_GETTER) \
|
||||
{ \
|
||||
std::vector< std::pair< ui8, si64 > > stats; \
|
||||
@ -3216,7 +3216,7 @@ void CGameState::obtainPlayersStats(SThievesGuildInfo & tgi, int level)
|
||||
stat.second = VAL_GETTER; \
|
||||
stats.push_back(stat); \
|
||||
} \
|
||||
tgi.FIELD = HLP::getRank(stats); \
|
||||
tgi.FIELD = statsHLP::getRank(stats); \
|
||||
}
|
||||
|
||||
for(std::map<ui8, PlayerState>::const_iterator g = players.begin(); g != players.end(); ++g)
|
||||
@ -3236,7 +3236,7 @@ void CGameState::obtainPlayersStats(SThievesGuildInfo & tgi, int level)
|
||||
{
|
||||
if(g->second.color == 255)
|
||||
continue;
|
||||
const CGHeroInstance * best = HLP::findBestHero(this, g->second.color);
|
||||
const CGHeroInstance * best = statsHLP::findBestHero(this, g->second.color);
|
||||
InfoAboutHero iah;
|
||||
iah.initFromHero(best, level >= 8);
|
||||
iah.army.slots.clear();
|
||||
@ -3261,7 +3261,7 @@ void CGameState::obtainPlayersStats(SThievesGuildInfo & tgi, int level)
|
||||
}
|
||||
if(level >= 5) //artifacts
|
||||
{
|
||||
FILL_FIELD(artifacts, HLP::getNumberOfArts(&g->second))
|
||||
FILL_FIELD(artifacts, statsHLP::getNumberOfArts(&g->second))
|
||||
}
|
||||
if(level >= 6) //army strength
|
||||
{
|
||||
|
Reference in New Issue
Block a user