Browse Source

Fix render priority of heroes

Ivan Savenko 2 years ago
parent
commit
1d03900f16
1 changed files with 6 additions and 0 deletions
  1. 6 0
      client/mapView/mapHandler.cpp

+ 6 - 0
client/mapView/mapHandler.cpp

@@ -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;
 }