mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Map objects order should be close to H3
This commit is contained in:
parent
7df5c612f7
commit
cd5f0bb36f
@ -138,8 +138,15 @@ bool CMapHandler::compareObjectBlitOrder(const CGObjectInstance * a, const CGObj
|
|||||||
return true;
|
return true;
|
||||||
if (!b)
|
if (!b)
|
||||||
return false;
|
return false;
|
||||||
if (a->appearance->printPriority != b->appearance->printPriority)
|
|
||||||
return a->appearance->printPriority > b->appearance->printPriority;
|
if (a->appearance->printPriority != 0 || b->appearance->printPriority != 0)
|
||||||
|
{
|
||||||
|
if (a->appearance->printPriority != b->appearance->printPriority)
|
||||||
|
return a->appearance->printPriority > b->appearance->printPriority;
|
||||||
|
|
||||||
|
//H3 behavior: order of two background objects depends on their placement order on map
|
||||||
|
return a->id < b->id;
|
||||||
|
}
|
||||||
|
|
||||||
if(a->pos.y != b->pos.y)
|
if(a->pos.y != b->pos.y)
|
||||||
return a->pos.y < b->pos.y;
|
return a->pos.y < b->pos.y;
|
||||||
@ -153,9 +160,10 @@ bool CMapHandler::compareObjectBlitOrder(const CGObjectInstance * a, const CGObj
|
|||||||
return true;
|
return true;
|
||||||
if(!b->isVisitable() && a->isVisitable())
|
if(!b->isVisitable() && a->isVisitable())
|
||||||
return false;
|
return false;
|
||||||
if(a->pos.x < b->pos.x)
|
|
||||||
return true;
|
//H3 behavior: order of two background objects depends on their placement order on map
|
||||||
return false;
|
return a->id < b->id;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CMapHandler::CMapHandler(const CMap * map)
|
CMapHandler::CMapHandler(const CMap * map)
|
||||||
|
Loading…
Reference in New Issue
Block a user