Explorar o código

Code style fixes

Ivan Savenko hai 1 ano
pai
achega
1f7e53a609

+ 1 - 1
client/ClientCommandManager.cpp

@@ -272,7 +272,7 @@ void ClientCommandManager::handleGetScriptsCommand()
 
 	boost::filesystem::create_directories(outPath);
 
-	for(auto & kv : VLC->scriptHandler->objects)
+	for(const auto & kv : VLC->scriptHandler->objects)
 	{
 		std::string name = kv.first;
 		boost::algorithm::replace_all(name,":","_");

+ 1 - 1
client/render/Canvas.cpp

@@ -188,7 +188,7 @@ void Canvas::fillTexture(const std::shared_ptr<IImage>& image)
 	if (!image)
 		return;
 		
-	Rect imageArea = Rect(Point(0, 0), image->dimensions());
+	Rect imageArea(Point(0, 0), image->dimensions());
 	for (int y=0; y < surface->h; y+= imageArea.h)
 	{
 		for (int x=0; x < surface->w; x+= imageArea.w)

+ 2 - 2
client/windows/CHeroBackpackWindow.cpp

@@ -21,7 +21,7 @@
 #include "CPlayerInterface.h"
 
 CHeroBackpackWindow::CHeroBackpackWindow(const CGHeroInstance * hero)
-	: CStatusbarWindow((EOptions)0)
+	: CStatusbarWindow(0)
 {
 	OBJECT_CONSTRUCTION_CAPTURING(255 - DISPOSE);
 
@@ -49,7 +49,7 @@ void CHeroBackpackWindow::showAll(Canvas & to)
 }
 
 CHeroQuickBackpackWindow::CHeroQuickBackpackWindow(const CGHeroInstance * hero, ArtifactPosition targetSlot)
-	: CWindowObject((EOptions)0)
+	: CWindowObject(0)
 {
 	OBJECT_CONSTRUCTION_CAPTURING(255 - DISPOSE);
 

+ 1 - 1
lib/CCreatureSet.cpp

@@ -992,7 +992,7 @@ ArtBearer::ArtBearer CCommanderInstance::bearerType() const
 
 bool CCommanderInstance::gainsLevel() const
 {
-	return experience >= static_cast<TExpType>(VLC->heroh->reqExp(level + 1));
+	return experience >= VLC->heroh->reqExp(level + 1);
 }
 
 //This constructor should be placed here to avoid side effects

+ 1 - 1
lib/pathfinder/PathfinderOptions.h

@@ -24,8 +24,8 @@ struct DLL_LINKAGE PathfinderOptions
 {
 	bool useFlying;
 	bool useWaterWalking;
-	bool useEmbarkAndDisembark;
 	bool ignoreGuards;
+	bool useEmbarkAndDisembark;
 	bool useTeleportTwoWay; // Two-way monoliths and Subterranean Gate
 	bool useTeleportOneWay; // One-way monoliths with one known exit only
 	bool useTeleportOneWayRandom; // One-way monoliths with more than one known exit