From cf56f7ccce97e4996dee0437e934f8dcd1e6e650 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 23 Jan 2023 02:58:41 +0300 Subject: [PATCH] vcmi: remove unused-but-set-variables --- client/battle/BattleInterface.cpp | 3 --- client/lobby/CBonusSelection.cpp | 2 -- client/mainmenu/CMainMenu.cpp | 5 ----- lib/rmg/CMapGenOptions.cpp | 4 +--- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/client/battle/BattleInterface.cpp b/client/battle/BattleInterface.cpp index 06e84033a..14ade3839 100644 --- a/client/battle/BattleInterface.cpp +++ b/client/battle/BattleInterface.cpp @@ -207,11 +207,8 @@ void BattleInterface::stacksAreAttacked(std::vector attackedI std::array killedBySide = {0, 0}; - int targets = 0; for(const StackAttackedInfo & attackedInfo : attackedInfos) { - ++targets; - ui8 side = attackedInfo.defender->side; killedBySide.at(side) += attackedInfo.amountKilled; } diff --git a/client/lobby/CBonusSelection.cpp b/client/lobby/CBonusSelection.cpp index f562d95ae..7c843c15a 100644 --- a/client/lobby/CBonusSelection.cpp +++ b/client/lobby/CBonusSelection.cpp @@ -119,7 +119,6 @@ CBonusSelection::CBonusSelection() void CBonusSelection::loadPositionsOfGraphics() { const JsonNode config(ResourceID("config/campaign_regions.json")); - int idx = 0; for(const JsonNode & campaign : config["campaign_regions"].Vector()) { @@ -140,7 +139,6 @@ void CBonusSelection::loadPositionsOfGraphics() campDescriptions.push_back(sc); - idx++; } } diff --git a/client/mainmenu/CMainMenu.cpp b/client/mainmenu/CMainMenu.cpp index 814015686..094760366 100644 --- a/client/mainmenu/CMainMenu.cpp +++ b/client/mainmenu/CMainMenu.cpp @@ -439,11 +439,6 @@ CMultiPlayers::CMultiPlayers(const std::string & firstPlayer, ESelectionScreen S void CMultiPlayers::onChange(std::string newText) { - size_t namesCount = 0; - - for(auto & elem : inputNames) - if(!elem->getText().empty()) - namesCount++; } void CMultiPlayers::enterSelectionScreen() diff --git a/lib/rmg/CMapGenOptions.cpp b/lib/rmg/CMapGenOptions.cpp index 098511bfe..e2c700fb6 100644 --- a/lib/rmg/CMapGenOptions.cpp +++ b/lib/rmg/CMapGenOptions.cpp @@ -322,7 +322,7 @@ void CMapGenOptions::finalize(CRandomGenerator & rand) //setWidth(50); logGlobal->trace("Player config:"); - int humanPlayers = 0, cpuOnlyPlayers = 0, AIplayers = 0; + int cpuOnlyPlayers = 0; for (auto player : players) { std::string playerType; @@ -330,7 +330,6 @@ void CMapGenOptions::finalize(CRandomGenerator & rand) { case EPlayerType::AI: playerType = "AI"; - AIplayers++; break; case EPlayerType::COMP_ONLY: playerType = "computer only"; @@ -338,7 +337,6 @@ void CMapGenOptions::finalize(CRandomGenerator & rand) break; case EPlayerType::HUMAN: playerType = "human only"; - humanPlayers++; break; default: assert(false);