1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

Support for fading heroes/boats (+flags);

Disabled map movement requests during fade;
This commit is contained in:
Fay
2015-02-09 16:03:24 +01:00
parent 3c3fb0e21d
commit cbb75d1c7a
3 changed files with 224 additions and 175 deletions

View File

@ -693,7 +693,7 @@ void CAdvMapInt::fsleepWake()
void CAdvMapInt::fmoveHero()
{
const CGHeroInstance *h = curHero();
if (!h || !terrain.currentPath)
if (!h || !terrain.currentPath || !CGI->mh->canStartHeroMovement())
return;
LOCPLINT->moveHero(h, *terrain.currentPath);
@ -1169,6 +1169,9 @@ void CAdvMapInt::keyPressed(const SDL_KeyboardEvent & key)
#endif // VCMI_SDL1
if(k < 0 || k > 8)
return;
if (!CGI->mh->canStartHeroMovement())
return;
int3 dir = directions[k];
@ -1439,7 +1442,8 @@ void CAdvMapInt::tileLClicked(const int3 &mapPos)
{
if (terrain.currentPath && terrain.currentPath->endPos() == mapPos)//we'll be moving
{
LOCPLINT->moveHero(currentHero,*terrain.currentPath);
if (CGI->mh->canStartHeroMovement())
LOCPLINT->moveHero(currentHero,*terrain.currentPath);
return;
}
else/* if(mp.z == currentHero->pos.z)*/ //remove old path and find a new one if we clicked on the map level on which hero is present