1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fix render priority of heroes

This commit is contained in:
Ivan Savenko 2023-03-06 00:28:20 +02:00
parent 322b8e8840
commit 1d03900f16

View File

@ -118,6 +118,12 @@ bool CMapHandler::compareObjectBlitOrder(const CGObjectInstance * a, const CGObj
if(a->pos.y != b->pos.y)
return a->pos.y < b->pos.y;
// heroes should appear on top of objects on the same tile
if(b->ID==Obj::HERO && a->ID!=Obj::HERO)
return true;
if(b->ID!=Obj::HERO && a->ID==Obj::HERO)
return false;
// or, if all other tests fail to determine priority - simply based on H3M order
return a->id < b->id;
}