1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Remove duplicate semicolons

This commit is contained in:
Alexander Wilms
2024-01-16 19:02:39 +00:00
parent a5e95cce96
commit cca08e29da
20 changed files with 26 additions and 26 deletions

View File

@ -101,7 +101,7 @@ void AIGateway::heroMoved(const TryMoveHero & details, bool verbose)
if(!hero) if(!hero)
validateObject(details.id); //enemy hero may have left visible area validateObject(details.id); //enemy hero may have left visible area
const int3 from = hero ? hero->convertToVisitablePos(details.start) : (details.start - int3(0,1,0));; const int3 from = hero ? hero->convertToVisitablePos(details.start) : (details.start - int3(0,1,0));
const int3 to = hero ? hero->convertToVisitablePos(details.end) : (details.end - int3(0,1,0)); const int3 to = hero ? hero->convertToVisitablePos(details.end) : (details.end - int3(0,1,0));
const CGObjectInstance * o1 = vstd::frontOrNull(cb->getVisitableObjs(from, verbose)); const CGObjectInstance * o1 = vstd::frontOrNull(cb->getVisitableObjs(from, verbose));

View File

@ -104,7 +104,7 @@ void VCAI::heroMoved(const TryMoveHero & details, bool verbose)
validateObject(details.id); validateObject(details.id);
auto hero = cb->getHero(details.id); auto hero = cb->getHero(details.id);
const int3 from = hero ? hero->convertToVisitablePos(details.start) : (details.start - int3(0,1,0));; const int3 from = hero ? hero->convertToVisitablePos(details.start) : (details.start - int3(0,1,0));
const int3 to = hero ? hero->convertToVisitablePos(details.end) : (details.end - int3(0,1,0)); const int3 to = hero ? hero->convertToVisitablePos(details.end) : (details.end - int3(0,1,0));
const CGObjectInstance * o1 = vstd::frontOrNull(cb->getVisitableObjs(from, verbose)); const CGObjectInstance * o1 = vstd::frontOrNull(cb->getVisitableObjs(from, verbose));

View File

@ -304,7 +304,7 @@ void AdventureMapInterface::onSelectionChanged(const CArmedInstance *sel)
auto town = dynamic_cast<const CGTownInstance*>(sel); auto town = dynamic_cast<const CGTownInstance*>(sel);
widget->getInfoBar()->showTownSelection(town); widget->getInfoBar()->showTownSelection(town);
widget->getTownList()->updateWidget();; widget->getTownList()->updateWidget();
widget->getTownList()->select(town); widget->getTownList()->select(town);
widget->getHeroList()->select(nullptr); widget->getHeroList()->select(nullptr);
onHeroChanged(nullptr); onHeroChanged(nullptr);

View File

@ -301,7 +301,7 @@ EShortcut InterfaceObjectConfigurable::readHotkey(const JsonNode & config) const
EShortcut result = GH.shortcuts().findShortcut(config.String()); EShortcut result = GH.shortcuts().findShortcut(config.String());
if (result == EShortcut::NONE) if (result == EShortcut::NONE)
logGlobal->error("Invalid hotkey '%s' in interface configuration!", config.String()); logGlobal->error("Invalid hotkey '%s' in interface configuration!", config.String());
return result;; return result;
} }
std::shared_ptr<CPicture> InterfaceObjectConfigurable::buildPicture(const JsonNode & config) const std::shared_ptr<CPicture> InterfaceObjectConfigurable::buildPicture(const JsonNode & config) const

View File

@ -104,7 +104,7 @@ void CLabel::setColor(const ColorRGBA & Color)
size_t CLabel::getWidth() size_t CLabel::getWidth()
{ {
return graphics->fonts[font]->getStringWidth(visibleText());; return graphics->fonts[font]->getStringWidth(visibleText());
} }
CMultiLineLabel::CMultiLineLabel(Rect position, EFonts Font, ETextAlignment Align, const ColorRGBA & Color, const std::string & Text) : CMultiLineLabel::CMultiLineLabel(Rect position, EFonts Font, ETextAlignment Align, const ColorRGBA & Color, const std::string & Text) :

View File

@ -44,7 +44,7 @@ int32_t CHero::getIconIndex() const
std::string CHero::getJsonKey() const std::string CHero::getJsonKey() const
{ {
return modScope + ':' + identifier;; return modScope + ':' + identifier;
} }
HeroTypeID CHero::getId() const HeroTypeID CHero::getId() const
@ -172,7 +172,7 @@ int32_t CHeroClass::getIconIndex() const
std::string CHeroClass::getJsonKey() const std::string CHeroClass::getJsonKey() const
{ {
return modScope + ':' + identifier;; return modScope + ':' + identifier;
} }
HeroClassID CHeroClass::getId() const HeroClassID CHeroClass::getId() const

View File

@ -59,7 +59,7 @@ std::string CSkill::getNameTranslated() const
std::string CSkill::getJsonKey() const std::string CSkill::getJsonKey() const
{ {
return modScope + ':' + identifier;; return modScope + ':' + identifier;
} }
std::string CSkill::getDescriptionTextID(int level) const std::string CSkill::getDescriptionTextID(int level) const

View File

@ -75,7 +75,7 @@ const BuildingTypeUniqueID CBuilding::getUniqueTypeID() const
std::string CBuilding::getJsonKey() const std::string CBuilding::getJsonKey() const
{ {
return modScope + ':' + identifier;; return modScope + ':' + identifier;
} }
std::string CBuilding::getNameTranslated() const std::string CBuilding::getNameTranslated() const
@ -154,7 +154,7 @@ int32_t CFaction::getIconIndex() const
std::string CFaction::getJsonKey() const std::string CFaction::getJsonKey() const
{ {
return modScope + ':' + identifier;; return modScope + ':' + identifier;
} }
void CFaction::registerIcons(const IconRegistar & cb) const void CFaction::registerIcons(const IconRegistar & cb) const

View File

@ -54,7 +54,7 @@ std::optional<CampaignScenarioID> CGameStateCampaign::getHeroesSourceScenario()
auto bonus = currentBonus(); auto bonus = currentBonus();
if(bonus && bonus->type == CampaignBonusType::HEROES_FROM_PREVIOUS_SCENARIO) if(bonus && bonus->type == CampaignBonusType::HEROES_FROM_PREVIOUS_SCENARIO)
return static_cast<CampaignScenarioID>(bonus->info2);; return static_cast<CampaignScenarioID>(bonus->info2);
return campaignState->lastScenario(); return campaignState->lastScenario();
} }

View File

@ -202,7 +202,7 @@ TObjectTypeHandler CObjectClassesHandler::loadSubObjectFromJson(const std::strin
auto createdObject = handlerConstructors.at(handler)(); auto createdObject = handlerConstructors.at(handler)();
createdObject->modScope = scope; createdObject->modScope = scope;
createdObject->typeName = obj->identifier;; createdObject->typeName = obj->identifier;
createdObject->subTypeName = identifier; createdObject->subTypeName = identifier;
createdObject->type = obj->id; createdObject->type = obj->id;

View File

@ -1360,7 +1360,7 @@ void CMapSaverJson::writeTranslations()
if(Languages::getLanguageOptions(language).identifier.empty()) if(Languages::getLanguageOptions(language).identifier.empty())
{ {
logGlobal->error("Serializing of unsupported language %s is not permitted", language); logGlobal->error("Serializing of unsupported language %s is not permitted", language);
continue;; continue;
} }
logGlobal->trace("Saving translations, language: %s", language); logGlobal->trace("Saving translations, language: %s", language);
addToArchive(s.second, language + ".json"); addToArchive(s.second, language + ".json");

View File

@ -149,7 +149,7 @@ CreatureID MapReaderH3M::readCreature()
return CreatureID::NONE; return CreatureID::NONE;
if(result.getNum() < features.creaturesCount) if(result.getNum() < features.creaturesCount)
return remapIdentifier(result);; return remapIdentifier(result);
// this may be random creature in army/town, to be randomized later // this may be random creature in army/town, to be randomized later
CreatureID randomIndex(result.getNum() - features.creatureIdentifierInvalid - 1); CreatureID randomIndex(result.getNum() - features.creatureIdentifierInvalid - 1);
@ -166,7 +166,7 @@ TerrainId MapReaderH3M::readTerrain()
{ {
TerrainId result(readUInt8()); TerrainId result(readUInt8());
assert(result.getNum() < features.terrainsCount); assert(result.getNum() < features.terrainsCount);
return remapIdentifier(result);; return remapIdentifier(result);
} }
RoadId MapReaderH3M::readRoad() RoadId MapReaderH3M::readRoad()
@ -187,7 +187,7 @@ SecondarySkill MapReaderH3M::readSkill()
{ {
SecondarySkill result(readUInt8()); SecondarySkill result(readUInt8());
assert(result.getNum() < features.skillsCount); assert(result.getNum() < features.skillsCount);
return remapIdentifier(result);; return remapIdentifier(result);
} }
SpellID MapReaderH3M::readSpell() SpellID MapReaderH3M::readSpell()
@ -199,7 +199,7 @@ SpellID MapReaderH3M::readSpell()
return SpellID::PRESET; return SpellID::PRESET;
assert(result.getNum() < features.spellsCount); assert(result.getNum() < features.spellsCount);
return remapIdentifier(result);; return remapIdentifier(result);
} }
SpellID MapReaderH3M::readSpell32() SpellID MapReaderH3M::readSpell32()

View File

@ -402,7 +402,7 @@ void CZonePlacer::placeZones(CRandomGenerator * rand)
//TODO: Don't do this is fitness was improved //TODO: Don't do this is fitness was improved
moveOneZone(zones, totalForces, distances, overlaps); moveOneZone(zones, totalForces, distances, overlaps);
improved |= evaluateSolution();; improved |= evaluateSolution();
} }
if (!improved) if (!improved)

View File

@ -121,7 +121,7 @@ void RoadPlacer::drawRoads(bool secondary)
//Do not draw roads on underground rock or water //Do not draw roads on underground rock or water
roads.erase_if([this](const int3& pos) -> bool roads.erase_if([this](const int3& pos) -> bool
{ {
const auto* terrain = map.getTile(pos).terType;; const auto* terrain = map.getTile(pos).terType;
return !terrain->isPassable() || !terrain->isLand(); return !terrain->isPassable() || !terrain->isLand();
}); });

View File

@ -125,7 +125,7 @@ void MapHandler::drawRoad(QPainter & painter, int x, int y, int z)
if(tinfo.roadType) //print road from this tile if(tinfo.roadType) //print road from this tile
{ {
auto roadName = tinfo.roadType->getJsonKey();; auto roadName = tinfo.roadType->getJsonKey();
QRect source(0, 0, tileSize, tileSize / 2); QRect source(0, 0, tileSize, tileSize / 2);
ui8 rotation = (tinfo.extTileFlags >> 4) % 4; ui8 rotation = (tinfo.extTileFlags >> 4) % 4;
bool hflip = (rotation == 1 || rotation == 3); bool hflip = (rotation == 1 || rotation == 3);

View File

@ -321,7 +321,7 @@ namespace ERMConverter
{ {
ParamIO ret; ParamIO ret;
ret.isInput = true; ret.isInput = true;
ret.name = (std::visit(LVL1IexpToVar(), cmp)).str();; ret.name = (std::visit(LVL1IexpToVar(), cmp)).str();
return ret; return ret;
} }

View File

@ -1051,7 +1051,7 @@ void CVCMIServer::optionSetBonus(PlayerColor player, PlayerStartingBonus id)
if(s.castle == FactionID::RANDOM && id == PlayerStartingBonus::RESOURCE) //random castle - can't be resource if(s.castle == FactionID::RANDOM && id == PlayerStartingBonus::RESOURCE) //random castle - can't be resource
return; return;
s.bonus = id;; s.bonus = id;
} }
bool CVCMIServer::canUseThisHero(PlayerColor player, HeroTypeID ID) bool CVCMIServer::canUseThisHero(PlayerColor player, HeroTypeID ID)

View File

@ -293,7 +293,7 @@ void PlayerMessageProcessor::cheatMovement(PlayerColor player, const CGHeroInsta
bool unlimited = false; bool unlimited = false;
try try
{ {
smp.val = std::stol(words.at(0));; smp.val = std::stol(words.at(0));
} }
catch(std::logic_error&) catch(std::logic_error&)
{ {
@ -326,7 +326,7 @@ void PlayerMessageProcessor::cheatResources(PlayerColor player, std::vector<std:
int baseResourceAmount; int baseResourceAmount;
try try
{ {
baseResourceAmount = std::stol(words.at(0));; baseResourceAmount = std::stol(words.at(0));
} }
catch(std::logic_error&) catch(std::logic_error&)
{ {

View File

@ -71,7 +71,7 @@ protected:
const auto otherZone = subject->getZones().at(otherZoneId); const auto otherZone = subject->getZones().at(otherZoneId);
GTEST_ASSERT_NE(otherZone, nullptr); GTEST_ASSERT_NE(otherZone, nullptr);
EXPECT_THAT(thisZone->getTreasureInfo(), ContainerEq(otherZone->getTreasureInfo()));; EXPECT_THAT(thisZone->getTreasureInfo(), ContainerEq(otherZone->getTreasureInfo()));
} }
} }

View File

@ -87,7 +87,7 @@ TEST_F(ResourceManagerTest, notifyGoalImplemented)
EXPECT_FALSE(rm->notifyGoalCompleted(invalidGoal)); EXPECT_FALSE(rm->notifyGoalCompleted(invalidGoal));
EXPECT_FALSE(rm->hasTasksLeft()); EXPECT_FALSE(rm->hasTasksLeft());
TResources res(0,0,0,0,0,0,12345);; TResources res(0,0,0,0,0,0,12345);
rm->reserveResoures(res, invalidGoal); rm->reserveResoures(res, invalidGoal);
ASSERT_FALSE(rm->hasTasksLeft()) << "Can't push Invalid goal"; ASSERT_FALSE(rm->hasTasksLeft()) << "Can't push Invalid goal";
EXPECT_FALSE(rm->notifyGoalCompleted(invalidGoal)); EXPECT_FALSE(rm->notifyGoalCompleted(invalidGoal));