1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Create random obstacles that match terrain.

This commit is contained in:
DjWarmonger
2014-06-28 09:46:32 +02:00
parent 7aa8213cd5
commit 920f56969b
6 changed files with 89 additions and 19 deletions

View File

@ -178,16 +178,7 @@ std::set<int3> CGObjectInstance::getBlockedPos() const
std::set<int3> CGObjectInstance::getBlockedOffsets() const
{
std::set<int3> ret;
for(int w=0; w<getWidth(); ++w)
{
for(int h=0; h<getHeight(); ++h)
{
if (appearance.isBlockedAt(w, h))
ret.insert(int3(-w, -h, 0));
}
}
return ret;
return appearance.getBlockedOffsets();
}
void CGObjectInstance::setType(si32 ID, si32 subID)