vcmi/vcmi — pull request #10 by Macron1Robot (2014-05-17 23:27:30+00:00)
Title: Bug 0001789 correction (incorrect battle field detection)

There was
//look only for objects covering given tile
if( !obj || obj->pos.z != tile.z
|| !obj->coveringAt(tile.x - obj->pos.x, tile.y - obj->pos.y))

But in coveringAt there is
bool CGObjectInstance::coveringAt(int x, int y) const
{
return appearance.isVisibleAt(pos.x - x, pos.y - y);
}
So I changed it to
if( !obj || obj->pos.z != tile.z
|| !obj->coveringAt(tile.x, tile.y))
Seems to work (tested a little), but I don't yet understand mechanics of map layout. So I need proof from someone about coveringAt, that my correction is right.