mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
parent
e02f752211
commit
b434479b53
@ -1129,6 +1129,7 @@ void CAdvMapInt::centerOn(int3 on)
|
||||
|
||||
LOCPLINT->adventureInt->position.x=on.x;
|
||||
LOCPLINT->adventureInt->position.y=on.y;
|
||||
LOCPLINT->adventureInt->position.z=on.z;
|
||||
LOCPLINT->adventureInt->updateScreen=true;
|
||||
}
|
||||
CAdvMapInt::CurrentSelection::CurrentSelection()
|
||||
|
@ -215,6 +215,8 @@ bool CCallback::verifyPath(CPath * path, bool blockSea)
|
||||
((CGI->mh->ttiles[path->nodes[i].coord.x][path->nodes[i].coord.y][path->nodes[i].coord.z].terType!=EterrainType::water)
|
||||
&&
|
||||
(CGI->mh->ttiles[path->nodes[i-1].coord.x][path->nodes[i-1].coord.y][path->nodes[i-1].coord.z].terType==EterrainType::water))
|
||||
||
|
||||
(CGI->mh->ttiles[path->nodes[i-1].coord.x][path->nodes[i-1].coord.y][path->nodes[i-1].coord.z].terType==EterrainType::rock)
|
||||
|
||||
)
|
||||
return false;
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "CCallback.h"
|
||||
#include "SDL_Extensions.h"
|
||||
#include "hch/CLodHandler.h"
|
||||
#include "CPathfinder.h"
|
||||
#include <sstream>
|
||||
using namespace CSDL_Ext;
|
||||
class OCM_HLP_CGIN
|
||||
@ -210,6 +211,12 @@ void CPlayerInterface::heroMoved(const HeroMoveDetails & details)
|
||||
//initializing objects and performing first step of move
|
||||
CObjectInstance * ho = details.ho; //object representing this hero
|
||||
int3 hp = details.src;
|
||||
|
||||
if (adventureInt->terrain.currentPath) //&& hero is moving
|
||||
{
|
||||
adventureInt->terrain.currentPath->nodes.erase(adventureInt->terrain.currentPath->nodes.end()-1);
|
||||
}
|
||||
|
||||
if(details.dst.x+1 == details.src.x && details.dst.y+1 == details.src.y) //tl
|
||||
{
|
||||
ho->moveDir = 1;
|
||||
|
@ -58,6 +58,8 @@ CPath * CPathfinder::getPath(int3 src, int3 dest, const CHeroInstance * hero, un
|
||||
graph[i][j]->coord.x = i;
|
||||
graph[i][j]->coord.y = j;
|
||||
graph[i][j]->coord.z = dest.z;
|
||||
if (CGI->mh->ttiles[i][j][src.z].terType==EterrainType::rock)
|
||||
graph[i][j]->accesible = false;
|
||||
if ((blockLandSea) && (CGI->mh->ttiles[i][j][src.z].terType==EterrainType::water))
|
||||
graph[i][j]->accesible = false;
|
||||
else if ((!blockLandSea) && (CGI->mh->ttiles[i][j][src.z].terType!=EterrainType::water))
|
||||
|
Loading…
Reference in New Issue
Block a user