1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

* Compilation fix (missing includes, do not remove)

* New settings.txt file (needed for kingdom overview to work)
* Last remainings of h3m format: hero placeholders parsing
* Minor improvements
This commit is contained in:
Michał W. Urbańczyk
2010-02-01 17:07:46 +00:00
parent 9c404c5c14
commit 94fa59cf45
19 changed files with 186 additions and 52 deletions

View File

@ -263,7 +263,11 @@ void CMapHeader::initFromMemory( const unsigned char *bufor, int &i )
allowedHeroes[(i-pom)*8+yy] = true;
}
if(version>RoE) //probably reserved for further heroes
i+=4;
{
int placeholdersQty = readNormalNr(bufor, i); i+=4;
for(int p = 0; p < placeholdersQty; p++)
placeholdedHeroes.push_back(bufor[i++]);
}
}
void CMapHeader::loadPlayerInfo( int &pom, const unsigned char * bufor, int &i )
{
@ -333,7 +337,7 @@ void CMapHeader::loadPlayerInfo( int &pom, const unsigned char * bufor, int &i )
if(version != RoE)
{
i++; ////unknown byte
players[pom].powerPlacehodlers = bufor[i++];//unknown byte
int heroCount = bufor[i++];
i+=3;
for (int pp=0;pp<heroCount;pp++)
@ -1905,7 +1909,21 @@ void Mapa::readObjects( const unsigned char * bufor, int &i)
}
case 214: //hero placeholder
{
i+=3; //TODO: handle it more properly
CGHeroPlaceholder *hp = new CGHeroPlaceholder();;
nobj = hp;
int a = bufor[i++]; //unkown byte, seems to be always 0 (if not - scream!)
assert(!a);
int htid = bufor[i++]; //hero type id
nobj->subID = htid;
if(htid == 0xff)
hp->power = bufor[i++];
else
hp->power = 0;
break;
}
case 10: //Keymaster
{
@ -1954,7 +1972,7 @@ void Mapa::readObjects( const unsigned char * bufor, int &i)
nobj->pos = pos;
nobj->ID = defInfo->id;
nobj->id = objects.size();
if(nobj->ID != HEROI_TYPE)
if(nobj->ID != HEROI_TYPE && nobj->ID != 214)
nobj->subID = defInfo->subid;
nobj->defInfo = defInfo;
objects.push_back(nobj);