Fixed setting -1 as hero direction that was causing crashes, like #1488.

This commit is contained in:
Michał W. Urbańczyk committed 2013-10-13 20:05:34 +00:00
1 parent d5263d75f8
commit fde8c71c5e
1 file changed
+6 -2
+6 -2
View File
@@ -407,8 +407,12 @@ void TryMoveHero::applyGs( CGameState *gs )
CGHeroInstance *h = gs->getHero(id);
h->movement = movePoints;
if((result == SUCCESS || result == BLOCKING_VISIT || result == EMBARK || result == DISEMBARK) && start != end) {
h->moveDir = getDir(start,end);
if((result == SUCCESS || result == BLOCKING_VISIT || result == EMBARK || result == DISEMBARK) && start != end)
{
auto dir = getDir(start,end);
if(dir > 0 && dir <= 8)
h->moveDir = dir;
//else dont change movedir - hero might have traversed the subterranean gate, dorectopm shpuld be kept
}
if(result == EMBARK) //hero enters boat at dest tile