mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
a few minor fixes
This commit is contained in:
@ -485,6 +485,14 @@ void CTerrainRect::showPath()
|
|||||||
}
|
}
|
||||||
else if (cv[i+1].coord.x == cv[i].coord.x && cv[i+1].coord.y == cv[i].coord.y-1)
|
else if (cv[i+1].coord.x == cv[i].coord.x && cv[i+1].coord.y == cv[i].coord.y-1)
|
||||||
{
|
{
|
||||||
|
if(cv[i-1].coord.x == cv[i].coord.x+1 && cv[i-1].coord.y == cv[i].coord.y-1)
|
||||||
|
{
|
||||||
|
pn = 2;
|
||||||
|
}
|
||||||
|
if(cv[i-1].coord.x == cv[i].coord.x+1 && cv[i-1].coord.y == cv[i].coord.y)
|
||||||
|
{
|
||||||
|
pn = 3;
|
||||||
|
}
|
||||||
if(cv[i-1].coord.x == cv[i].coord.x+1 && cv[i-1].coord.y == cv[i].coord.y+1)
|
if(cv[i-1].coord.x == cv[i].coord.x+1 && cv[i-1].coord.y == cv[i].coord.y+1)
|
||||||
{
|
{
|
||||||
pn = 4;
|
pn = 4;
|
||||||
@ -497,6 +505,14 @@ void CTerrainRect::showPath()
|
|||||||
{
|
{
|
||||||
pn = 22;
|
pn = 22;
|
||||||
}
|
}
|
||||||
|
if(cv[i-1].coord.x == cv[i].coord.x-1 && cv[i-1].coord.y == cv[i].coord.y)
|
||||||
|
{
|
||||||
|
pn = 23;
|
||||||
|
}
|
||||||
|
if(cv[i-1].coord.x == cv[i].coord.x-1 && cv[i-1].coord.y == cv[i].coord.y-1)
|
||||||
|
{
|
||||||
|
pn = 24;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (cv[i+1].coord.x == cv[i].coord.x+1 && cv[i+1].coord.y == cv[i].coord.y-1)
|
else if (cv[i+1].coord.x == cv[i].coord.x+1 && cv[i+1].coord.y == cv[i].coord.y-1)
|
||||||
{
|
{
|
||||||
@ -561,6 +577,14 @@ void CTerrainRect::showPath()
|
|||||||
}
|
}
|
||||||
else if (cv[i+1].coord.x == cv[i].coord.x && cv[i+1].coord.y == cv[i].coord.y+1)
|
else if (cv[i+1].coord.x == cv[i].coord.x && cv[i+1].coord.y == cv[i].coord.y+1)
|
||||||
{
|
{
|
||||||
|
if(cv[i-1].coord.x == cv[i].coord.x-1 && cv[i-1].coord.y == cv[i].coord.y+1)
|
||||||
|
{
|
||||||
|
pn = 6;
|
||||||
|
}
|
||||||
|
if(cv[i-1].coord.x == cv[i].coord.x-1 && cv[i-1].coord.y == cv[i].coord.y)
|
||||||
|
{
|
||||||
|
pn = 7;
|
||||||
|
}
|
||||||
if(cv[i-1].coord.x == cv[i].coord.x-1 && cv[i-1].coord.y == cv[i].coord.y-1)
|
if(cv[i-1].coord.x == cv[i].coord.x-1 && cv[i-1].coord.y == cv[i].coord.y-1)
|
||||||
{
|
{
|
||||||
pn = 8;
|
pn = 8;
|
||||||
@ -573,6 +597,14 @@ void CTerrainRect::showPath()
|
|||||||
{
|
{
|
||||||
pn = 18;
|
pn = 18;
|
||||||
}
|
}
|
||||||
|
else if(cv[i-1].coord.x == cv[i].coord.x+1 && cv[i-1].coord.y == cv[i].coord.y)
|
||||||
|
{
|
||||||
|
pn = 19;
|
||||||
|
}
|
||||||
|
else if(cv[i-1].coord.x == cv[i].coord.x+1 && cv[i-1].coord.y == cv[i].coord.y+1)
|
||||||
|
{
|
||||||
|
pn = 20;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (cv[i+1].coord.x == cv[i].coord.x-1 && cv[i+1].coord.y == cv[i].coord.y+1)
|
else if (cv[i+1].coord.x == cv[i].coord.x-1 && cv[i+1].coord.y == cv[i].coord.y+1)
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,6 @@ void CDefObjInfoHandler::load()
|
|||||||
std::istringstream inp(bitmaph->getTextFile("ZOBJCTS.TXT"));
|
std::istringstream inp(bitmaph->getTextFile("ZOBJCTS.TXT"));
|
||||||
int objNumber;
|
int objNumber;
|
||||||
inp>>objNumber;
|
inp>>objNumber;
|
||||||
std::set<int> ids;
|
|
||||||
for(int hh=0; hh<objNumber; ++hh)
|
for(int hh=0; hh<objNumber; ++hh)
|
||||||
{
|
{
|
||||||
CGDefInfo* nobj = new CGDefInfo();
|
CGDefInfo* nobj = new CGDefInfo();
|
||||||
@ -68,10 +67,7 @@ void CDefObjInfoHandler::load()
|
|||||||
inp>>nobj->subid;
|
inp>>nobj->subid;
|
||||||
inp>>nobj->type;
|
inp>>nobj->type;
|
||||||
if(nobj->type == 2 || nobj->type == 3 || nobj->type == 4 || nobj->type == 5 || nobj->id == 111) //creature, hero, artifact, resource or whripool
|
if(nobj->type == 2 || nobj->type == 3 || nobj->type == 4 || nobj->type == 5 || nobj->id == 111) //creature, hero, artifact, resource or whripool
|
||||||
{
|
|
||||||
nobj->visitDir = 0xff;
|
nobj->visitDir = 0xff;
|
||||||
ids.insert(nobj->id);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
nobj->visitDir = (8|16|32|64|128); //disabled visiting from the top
|
nobj->visitDir = (8|16|32|64|128); //disabled visiting from the top
|
||||||
inp>>nobj->printPriority;
|
inp>>nobj->printPriority;
|
||||||
|
@ -1273,7 +1273,7 @@ void CGameHandler::setupBattle( BattleInfo * curB, int3 tile, CCreatureSet &army
|
|||||||
positions.open("config" PATHSEPARATOR "battleStartpos.txt", std::ios_base::in|std::ios_base::binary);
|
positions.open("config" PATHSEPARATOR "battleStartpos.txt", std::ios_base::in|std::ios_base::binary);
|
||||||
if(!positions.is_open())
|
if(!positions.is_open())
|
||||||
{
|
{
|
||||||
tlog0<<"Unable to open battleStartpos.txt!"<<std::endl;
|
tlog1<<"Unable to open battleStartpos.txt!"<<std::endl;
|
||||||
}
|
}
|
||||||
std::string dump;
|
std::string dump;
|
||||||
positions>>dump; positions>>dump;
|
positions>>dump; positions>>dump;
|
||||||
|
Reference in New Issue
Block a user