|
@@ -399,7 +399,7 @@ void SelectionObjectsLayer::draw()
|
|
redraw();
|
|
redraw();
|
|
}
|
|
}
|
|
|
|
|
|
-CGObjectInstance * SelectionObjectsLayer::selectObjectAt(int x, int y) const
|
|
|
|
|
|
+CGObjectInstance * SelectionObjectsLayer::selectObjectAt(int x, int y, const CGObjectInstance * ignore) const
|
|
{
|
|
{
|
|
if(!map || !map->isInTheMap(int3(x, y, scene->level)))
|
|
if(!map || !map->isInTheMap(int3(x, y, scene->level)))
|
|
return nullptr;
|
|
return nullptr;
|
|
@@ -409,7 +409,7 @@ CGObjectInstance * SelectionObjectsLayer::selectObjectAt(int x, int y) const
|
|
//visitable is most important
|
|
//visitable is most important
|
|
for(auto & object : objects)
|
|
for(auto & object : objects)
|
|
{
|
|
{
|
|
- if(!object.obj)
|
|
|
|
|
|
+ if(!object.obj || object.obj == ignore)
|
|
continue;
|
|
continue;
|
|
|
|
|
|
if(object.obj->visitableAt(x, y))
|
|
if(object.obj->visitableAt(x, y))
|
|
@@ -421,7 +421,7 @@ CGObjectInstance * SelectionObjectsLayer::selectObjectAt(int x, int y) const
|
|
//if not visitable tile - try to get blocked
|
|
//if not visitable tile - try to get blocked
|
|
for(auto & object : objects)
|
|
for(auto & object : objects)
|
|
{
|
|
{
|
|
- if(!object.obj)
|
|
|
|
|
|
+ if(!object.obj || object.obj == ignore)
|
|
continue;
|
|
continue;
|
|
|
|
|
|
if(object.obj->blockingAt(x, y))
|
|
if(object.obj->blockingAt(x, y))
|
|
@@ -433,7 +433,7 @@ CGObjectInstance * SelectionObjectsLayer::selectObjectAt(int x, int y) const
|
|
//finally, we can take any object
|
|
//finally, we can take any object
|
|
for(auto & object : objects)
|
|
for(auto & object : objects)
|
|
{
|
|
{
|
|
- if(!object.obj)
|
|
|
|
|
|
+ if(!object.obj || object.obj == ignore)
|
|
continue;
|
|
continue;
|
|
|
|
|
|
if(object.obj->coveringAt(x, y))
|
|
if(object.obj->coveringAt(x, y))
|