1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-29 00:41:38 +02:00

- fixed wrong battlefield (#961)

- minor tweaks
This commit is contained in:
Ivan Savenko
2012-05-19 11:47:26 +00:00
parent 7116377e4e
commit 6f6cd6814e
6 changed files with 29 additions and 26 deletions

View File

@ -1574,11 +1574,9 @@ int CGameState::battleGetBattlefieldType(int3 tile) const
BOOST_FOREACH(auto &obj, map->objects)
{
if( !obj || obj->pos.z != tile.z
|| obj->pos.x - tile.x < 0 || obj->pos.x - tile.x >= 8
|| tile.y - obj->pos.y + 5 < 0 || tile.y - obj->pos.y + 5 >=6
|| !obj->coveringAt(obj->pos.x - tile.x, tile.y - obj->pos.y + 5)
) //look only for objects covering given tile
//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))
continue;
switch(obj->ID)