瀏覽代碼

Fix render priority of heroes

Ivan Savenko 2 年之前
父節點
當前提交
1d03900f16
共有 1 個文件被更改,包括 6 次插入0 次删除
  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;
 }