1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

* fixed support for custom hero portrait in the game

* fixed problems with non-hero/town defs not present in defobjinfo but present on map (occurring probably only in case of def substitution in map editor)
* fixed hopefully issues with picking bonus in pregame
* no arrows in options in pregame for fixed hero
This commit is contained in:
Michał W. Urbańczyk
2009-02-08 17:19:42 +00:00
parent a113a8d289
commit c847d56a96
2 changed files with 31 additions and 13 deletions

18
map.cpp
View File

@ -874,7 +874,7 @@ void Mapa::loadHero( CGObjectInstance * &nobj, unsigned char * bufor, int &i )
bool portrait=bufor[i]; ++i;
if (portrait)
nhi->portrait = readChar(bufor,i);
nhi->portrait = bufor[i++];
if(readChar(bufor,i))//true if hero has specified abilities
{
int howMany = readNormalNr(bufor,i); i+=4;
@ -1309,7 +1309,21 @@ void Mapa::readDefInfo( unsigned char * bufor, int &i)
}
i+=16;
if(vinya->id!=34 && vinya->id!=70)
vinya->visitDir = VLC->dobjinfo->gobjs[vinya->id][vinya->subid]->visitDir;
{
CGDefInfo *h = VLC->dobjinfo->gobjs[vinya->id][vinya->subid];
if(!h)
{
//remove fake entry
VLC->dobjinfo->gobjs[vinya->id].erase(vinya->subid);
if(VLC->dobjinfo->gobjs[vinya->id].size())
VLC->dobjinfo->gobjs.erase(vinya->id);
tlog2<<"\t\tWarning: no defobjinfo entry for object ID="<<vinya->id<<" subID=" << vinya->subid<<std::endl;
}
else
{
vinya->visitDir = VLC->dobjinfo->gobjs[vinya->id][vinya->subid]->visitDir;
}
}
else
vinya->visitDir = 0xff;
defy.push_back(vinya); // add this def to the vector