1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

* reading of creature banks' names

This commit is contained in:
mateuszb 2009-09-17 11:05:50 +00:00
parent 320e3b9cde
commit 1a08772bc8
3 changed files with 8 additions and 3 deletions

View File

@ -695,7 +695,7 @@ list<int> CBattleLogic::PerformDefaultAction(int stackID, int &additionalInfo)
for (std::map<int, int>::iterator it = votes.begin(); it != votes.end(); ++it)
{
if (m_cb->battleGetStackByID(it->first)->attackerOwned == m_side //it's hostile stack
if (bool(m_cb->battleGetStackByID(it->first)->attackerOwned) == m_side //it's hostile stack
&& it->second > max_vote)
{
max_vote = it->second;

View File

@ -154,8 +154,12 @@ void CObjectHandler::loadObjects()
for(int g=0; g<21; ++g) //TODO: remove hardcoded value
{
//reading name - TODO: use it if necessary
//reading name
istr.getline(buffer, MAX_BUF, '\t');
creBanksNames[g] = std::string(buffer);
//remove trailing new line characters
while(creBanksNames[g][0] == 10 || creBanksNames[g][0] == 13)
creBanksNames[g].erase(creBanksNames[g].begin());
for(int i=0; i<4; ++i) //reading levels
{

View File

@ -951,7 +951,8 @@ class DLL_EXPORT CObjectHandler
{
public:
std::vector<si32> cregens; //type 17. dwelling subid -> creature ID
std::map <ui32, std::vector <BankConfig> > banksInfo; //[index][preset], TODO: load it
std::map <ui32, std::vector <BankConfig> > banksInfo; //[index][preset]
std::map <ui32, std::string> creBanksNames; //[crebank index] -> name of this creature bank
void loadObjects();