1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-24 03:47:18 +02:00

a few minor fixes

This commit is contained in:
mateuszb 2008-09-19 11:19:14 +00:00
parent 856698bd80
commit f97628e67f
3 changed files with 33 additions and 5 deletions

View File

@ -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)
{
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)
{
pn = 4;
@ -497,6 +505,14 @@ void CTerrainRect::showPath()
{
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)
{
@ -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)
{
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)
{
pn = 8;
@ -573,6 +597,14 @@ void CTerrainRect::showPath()
{
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)
{

View File

@ -27,7 +27,6 @@ void CDefObjInfoHandler::load()
std::istringstream inp(bitmaph->getTextFile("ZOBJCTS.TXT"));
int objNumber;
inp>>objNumber;
std::set<int> ids;
for(int hh=0; hh<objNumber; ++hh)
{
CGDefInfo* nobj = new CGDefInfo();
@ -68,10 +67,7 @@ void CDefObjInfoHandler::load()
inp>>nobj->subid;
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
{
nobj->visitDir = 0xff;
ids.insert(nobj->id);
}
else
nobj->visitDir = (8|16|32|64|128); //disabled visiting from the top
inp>>nobj->printPriority;

View File

@ -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);
if(!positions.is_open())
{
tlog0<<"Unable to open battleStartpos.txt!"<<std::endl;
tlog1<<"Unable to open battleStartpos.txt!"<<std::endl;
}
std::string dump;
positions>>dump; positions>>dump;