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

Now hero movement should be working.

- fixed/added #22, #24, #25, #8, #11, partially #19
- minor improvements
This commit is contained in:
Michał W. Urbańczyk
2007-10-05 18:16:22 +00:00
parent 49565e6b45
commit e02f752211
9 changed files with 256 additions and 42 deletions

View File

@ -41,12 +41,17 @@ int internalFunc(void * callback)
break;
case 'H': //position of hero
readed>>heronum;
std::cout<<"Position of hero "<<heronum<<": "<<CGI->heroh->heroInstances[heronum]->pos<<std::endl;
break;
case 'M': //move hero
readed>>heronum>>dest;
cb->moveHero(heronum, dest);
std::cout<<"Position of hero "<<heronum<<": "<<CGI->heroh->heroInstances[heronum]->getPosition(false)<<std::endl;
break;
case 'M': //move heroa
{
readed>>heronum>>dest;
const CHeroInstance * hero = cb->getHeroInfo(0,heronum,0);
CPath * path = CGI->pathf->getPath(hero->getPosition(false),dest,hero);
cb->moveHero(heronum, path, 0, 0);
delete path;
break;
}
case 'D': //pos description
readed>>src;
CGI->mh->getObjDescriptions(src);