Explorar o código

Fix render priority of heroes

Ivan Savenko %!s(int64=2) %!d(string=hai) anos
pai
achega
1d03900f16
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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;
 }