1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

* flaggable objects change their color on minimap when taken over

* corrected damage inflicted by spells and ballista
* minor changes
This commit is contained in:
mateuszb
2009-07-30 12:49:45 +00:00
parent fec75cdc04
commit 8e63c73cf8
16 changed files with 227 additions and 69 deletions

View File

@ -185,8 +185,8 @@ bool CGObjectInstance::blockingAt(int x, int y) const
if(x<0 || y<0 || x>=getWidth() || y>=getHeight() || defInfo==NULL)
return false;
if((defInfo->blockMap[y+6-getHeight()] >> (7-(8-getWidth()+x) )) & 1)
return true;
return false;
return false;
return true;
}
bool CGObjectInstance::coveringAt(int x, int y) const
@ -196,6 +196,20 @@ bool CGObjectInstance::coveringAt(int x, int y) const
return false;
}
std::set<int3> CGObjectInstance::getBlockedPos() const
{
std::set<int3> ret;
for(int w=0; w<getWidth(); ++w)
{
for(int h=0; h<getHeight(); ++h)
{
if(blockingAt(w, h))
ret.insert(int3(pos.x - getWidth() + w + 1, pos.y - getHeight() + h + 1, pos.z));
}
}
return ret;
}
bool CGObjectInstance::operator<(const CGObjectInstance & cmp) const //screen printing priority comparing
{
if(defInfo->printPriority==1 && cmp.defInfo->printPriority==0)