diff --git a/AI/BattleAI/BattleAI.cpp b/AI/BattleAI/BattleAI.cpp index 41a885b89..a4c91a431 100644 --- a/AI/BattleAI/BattleAI.cpp +++ b/AI/BattleAI/BattleAI.cpp @@ -176,7 +176,7 @@ void CBattleAI::activeStack(const BattleID & battleID, const CStack * stack ) movesSkippedByDefense = 0; } - logAi->trace("BattleAI decission made in %lld", timeElapsed(start)); + logAi->trace("BattleAI decision made in %lld", timeElapsed(start)); cb->battleMakeUnitAction(battleID, result); } diff --git a/AI/BattleAI/BattleAI.h b/AI/BattleAI/BattleAI.h index 497a77f3f..7074667ef 100644 --- a/AI/BattleAI/BattleAI.h +++ b/AI/BattleAI/BattleAI.h @@ -50,7 +50,7 @@ struct CurrentOffensivePotential return ourPotential - enemyPotential; } }; -*/ // These lines may be usefull but they are't used in the code. +*/ // These lines may be useful but they are't used in the code. class CBattleAI : public CBattleGameInterface { diff --git a/AI/BattleAI/BattleEvaluator.cpp b/AI/BattleAI/BattleEvaluator.cpp index 984d02d5d..7ad134b7c 100644 --- a/AI/BattleAI/BattleEvaluator.cpp +++ b/AI/BattleAI/BattleEvaluator.cpp @@ -196,7 +196,7 @@ BattleAction BattleEvaluator::selectStackAction(const CStack * stack) } } - //ThreatMap threatsToUs(stack); // These lines may be usefull but they are't used in the code. + //ThreatMap threatsToUs(stack); // These lines may be useful but they are't used in the code. if(moveTarget.scorePerTurn > score) { score = moveTarget.score; diff --git a/AI/BattleAI/BattleExchangeVariant.cpp b/AI/BattleAI/BattleExchangeVariant.cpp index 1f83b58e8..e1d390f19 100644 --- a/AI/BattleAI/BattleExchangeVariant.cpp +++ b/AI/BattleAI/BattleExchangeVariant.cpp @@ -13,7 +13,7 @@ AttackerValue::AttackerValue() : value(0), - isRetalitated(false) + isRetaliated(false) { } @@ -57,14 +57,14 @@ float BattleExchangeVariant::trackAttack( attackValue -= attackerDamageReduce; dpsScore.ourDamageReduce += attackerDamageReduce; - attackerValue[unitToUpdate->unitId()].isRetalitated = true; + attackerValue[unitToUpdate->unitId()].isRetaliated = true; unitToUpdate->damage(retaliationDamage); defender->afterAttack(false, true); #if BATTLE_TRACE_LEVEL>=1 logAi->trace( - "%s -> %s, ap retalitation, %s, dps: %2f, score: %2f", + "%s -> %s, ap retaliation, %s, dps: %2f, score: %2f", defender->getDescription(), unitToUpdate->getDescription(), ap.attack.shooting ? "shot" : "mellee", @@ -185,7 +185,7 @@ float BattleExchangeVariant::trackAttack( if(isOurAttack) { dpsScore.ourDamageReduce += attackerDamageReduce; - attackerValue[attacker->unitId()].isRetalitated = true; + attackerValue[attacker->unitId()].isRetaliated = true; } else { diff --git a/AI/BattleAI/BattleExchangeVariant.h b/AI/BattleAI/BattleExchangeVariant.h index 610e47166..00a0dd5ba 100644 --- a/AI/BattleAI/BattleExchangeVariant.h +++ b/AI/BattleAI/BattleExchangeVariant.h @@ -45,7 +45,7 @@ struct BattleScore struct AttackerValue { float value; - bool isRetalitated; + bool isRetaliated; BattleHex position; AttackerValue(); diff --git a/AI/BattleAI/ThreatMap.cpp b/AI/BattleAI/ThreatMap.cpp index 5b3bab584..14cce4f56 100644 --- a/AI/BattleAI/ThreatMap.cpp +++ b/AI/BattleAI/ThreatMap.cpp @@ -70,4 +70,4 @@ ThreatMap::ThreatMap(const CStack *Endangered) : endangered(Endangered) }); } } -*/ // These lines may be usefull but they are't used in the code. +*/ // These lines may be useful but they are't used in the code. diff --git a/AI/BattleAI/ThreatMap.h b/AI/BattleAI/ThreatMap.h index 2d800a72c..a480b8004 100644 --- a/AI/BattleAI/ThreatMap.h +++ b/AI/BattleAI/ThreatMap.h @@ -22,4 +22,4 @@ public: std::array sufferedDamage; ThreatMap(const CStack *Endangered); -};*/ // These lines may be usefull but they are't used in the code. +};*/ // These lines may be useful but they are't used in the code. diff --git a/AI/Nullkiller/AIGateway.cpp b/AI/Nullkiller/AIGateway.cpp index b099a270e..330183de1 100644 --- a/AI/Nullkiller/AIGateway.cpp +++ b/AI/Nullkiller/AIGateway.cpp @@ -500,7 +500,7 @@ void AIGateway::objectPropertyChanged(const SetObjectProperty * sop) if(relations == PlayerRelations::ENEMIES) { //we want to visit objects owned by oppponents - //addVisitableObj(obj); // TODO: Remove once save compatability broken. In past owned objects were removed from this set + //addVisitableObj(obj); // TODO: Remove once save compatibility broken. In past owned objects were removed from this set nullkiller->memory->markObjectUnvisited(obj); } else if(relations == PlayerRelations::SAME_PLAYER && obj->ID == Obj::TOWN) @@ -705,7 +705,7 @@ void AIGateway::showTeleportDialog(const CGHeroInstance * hero, TeleportChannelI NET_EVENT_HANDLER; status.addQuery(askID, boost::str(boost::format("Teleport dialog query with %d exits") % exits.size())); - int choosenExit = -1; + int chosenExit = -1; if(impassable) { nullkiller->memory->knownTeleportChannels[channel]->passability = TeleportChannel::IMPASSABLE; @@ -714,14 +714,14 @@ void AIGateway::showTeleportDialog(const CGHeroInstance * hero, TeleportChannelI { auto neededExit = std::make_pair(destinationTeleport, destinationTeleportPos); if(destinationTeleport != ObjectInstanceID() && vstd::contains(exits, neededExit)) - choosenExit = vstd::find_pos(exits, neededExit); + chosenExit = vstd::find_pos(exits, neededExit); } for(auto exit : exits) { if(status.channelProbing() && exit.first == destinationTeleport) { - choosenExit = vstd::find_pos(exits, exit); + chosenExit = vstd::find_pos(exits, exit); break; } else @@ -739,7 +739,7 @@ void AIGateway::showTeleportDialog(const CGHeroInstance * hero, TeleportChannelI requestActionASAP([=]() { - answerQuery(askID, choosenExit); + answerQuery(askID, chosenExit); }); } @@ -1452,7 +1452,7 @@ void AIGateway::tryRealize(Goals::Trade & g) //trade if(cb->getResourceAmount(GameResID(g.resID)) >= g.value) //goal is already fulfilled. Why we need this check, anyway? throw goalFulfilledException(sptr(g)); - int accquiredResources = 0; + int acquiredResources = 0; if(const CGObjectInstance * obj = cb->getObj(ObjectInstanceID(g.objid), false)) { if(const auto * m = dynamic_cast(obj)) @@ -1472,8 +1472,8 @@ void AIGateway::tryRealize(Goals::Trade & g) //trade if (toGive) //don't try to sell 0 resources { cb->trade(m, EMarketMode::RESOURCE_RESOURCE, res, GameResID(g.resID), toGive); - accquiredResources = static_cast(toGet * (it->resVal / toGive)); - logAi->debug("Traded %d of %s for %d of %s at %s", toGive, res, accquiredResources, g.resID, obj->getObjectName()); + acquiredResources = static_cast(toGet * (it->resVal / toGive)); + logAi->debug("Traded %d of %s for %d of %s at %s", toGive, res, acquiredResources, g.resID, obj->getObjectName()); } if (cb->getResourceAmount(GameResID(g.resID))) throw goalFulfilledException(sptr(g)); //we traded all we needed diff --git a/AI/Nullkiller/AIGateway.h b/AI/Nullkiller/AIGateway.h index 03c59d6e4..159ffd8f3 100644 --- a/AI/Nullkiller/AIGateway.h +++ b/AI/Nullkiller/AIGateway.h @@ -95,7 +95,7 @@ public: AIGateway(); virtual ~AIGateway(); - //TODO: extract to apropriate goals + //TODO: extract to appropriate goals void tryRealize(Goals::DigAtTile & g); void tryRealize(Goals::Trade & g); diff --git a/AI/Nullkiller/AIUtility.cpp b/AI/Nullkiller/AIUtility.cpp index 462c56112..7d2f57710 100644 --- a/AI/Nullkiller/AIUtility.cpp +++ b/AI/Nullkiller/AIUtility.cpp @@ -434,9 +434,9 @@ bool townHasFreeTavern(const CGTownInstance * town) if(!town->hasBuilt(BuildingID::TAVERN)) return false; if(!town->visitingHero) return true; - bool canMoveVisitingHeroToGarnison = !town->getUpperArmy()->stacksCount(); + bool canMoveVisitingHeroToGarrison = !town->getUpperArmy()->stacksCount(); - return canMoveVisitingHeroToGarnison; + return canMoveVisitingHeroToGarrison; } uint64_t getHeroArmyStrengthWithCommander(const CGHeroInstance * hero, const CCreatureSet * heroArmy) diff --git a/AI/Nullkiller/Analyzers/BuildAnalyzer.cpp b/AI/Nullkiller/Analyzers/BuildAnalyzer.cpp index a50ccc255..2580a3b7e 100644 --- a/AI/Nullkiller/Analyzers/BuildAnalyzer.cpp +++ b/AI/Nullkiller/Analyzers/BuildAnalyzer.cpp @@ -267,7 +267,7 @@ BuildingInfo BuildAnalyzer::getBuildingOrPrerequisite( BuildingInfo prerequisite = getBuildingOrPrerequisite(town, missingBuildings[0], excludeDwellingDependencies); - prerequisite.buildCostWithPrerequisits += info.buildCost; + prerequisite.buildCostWithPrerequisites += info.buildCost; prerequisite.creatureCost = info.creatureCost; prerequisite.creatureGrows = info.creatureGrows; prerequisite.creatureLevel = info.creatureLevel; @@ -340,7 +340,7 @@ void TownDevelopmentInfo::addExistingDwelling(const BuildingInfo & existingDwell void TownDevelopmentInfo::addBuildingToBuild(const BuildingInfo & nextToBuild) { - townDevelopmentCost += nextToBuild.buildCostWithPrerequisits; + townDevelopmentCost += nextToBuild.buildCostWithPrerequisites; if(nextToBuild.canBuild) { @@ -361,7 +361,7 @@ BuildingInfo::BuildingInfo() creatureGrows = 0; creatureID = CreatureID::NONE; buildCost = 0; - buildCostWithPrerequisits = 0; + buildCostWithPrerequisites = 0; prerequisitesCount = 0; name.clear(); armyStrength = 0; @@ -376,7 +376,7 @@ BuildingInfo::BuildingInfo( { id = building->bid; buildCost = building->resources; - buildCostWithPrerequisits = building->resources; + buildCostWithPrerequisites = building->resources; dailyIncome = building->produce; exists = town->hasBuilt(id); prerequisitesCount = 1; diff --git a/AI/Nullkiller/Analyzers/BuildAnalyzer.h b/AI/Nullkiller/Analyzers/BuildAnalyzer.h index 019d3245f..430922d94 100644 --- a/AI/Nullkiller/Analyzers/BuildAnalyzer.h +++ b/AI/Nullkiller/Analyzers/BuildAnalyzer.h @@ -22,7 +22,7 @@ class DLL_EXPORT BuildingInfo public: BuildingID id; TResources buildCost; - TResources buildCostWithPrerequisits; + TResources buildCostWithPrerequisites; int creatureGrows; uint8_t creatureLevel; TResources creatureCost; diff --git a/AI/Nullkiller/Behaviors/DefenceBehavior.cpp b/AI/Nullkiller/Behaviors/DefenceBehavior.cpp index f6bf88ced..e23efcb1c 100644 --- a/AI/Nullkiller/Behaviors/DefenceBehavior.cpp +++ b/AI/Nullkiller/Behaviors/DefenceBehavior.cpp @@ -240,7 +240,7 @@ void DefenceBehavior::evaluateDefence(Goals::TGoalVec & tasks, const CGTownInsta if(path.turn() <= threat.turn - 2) { #if NKAI_TRACE_LEVEL >= 1 - logAi->trace("Defer defence of %s by %s because he has enough time to reach the town next trun", + logAi->trace("Defer defence of %s by %s because he has enough time to reach the town next turn", town->getObjectName(), path.targetHero->getObjectName()); #endif diff --git a/AI/Nullkiller/Engine/Nullkiller.cpp b/AI/Nullkiller/Engine/Nullkiller.cpp index c1a2c553f..fa15363f6 100644 --- a/AI/Nullkiller/Engine/Nullkiller.cpp +++ b/AI/Nullkiller/Engine/Nullkiller.cpp @@ -399,7 +399,7 @@ void Nullkiller::makeTurn() auto selectedTasks = buildPlan(bestTasks); - logAi->debug("Decission madel in %ld", timeElapsed(start)); + logAi->debug("Decision madel in %ld", timeElapsed(start)); if(selectedTasks.empty()) { diff --git a/AI/Nullkiller/Engine/PriorityEvaluator.cpp b/AI/Nullkiller/Engine/PriorityEvaluator.cpp index 9f563ee32..f29153c20 100644 --- a/AI/Nullkiller/Engine/PriorityEvaluator.cpp +++ b/AI/Nullkiller/Engine/PriorityEvaluator.cpp @@ -33,7 +33,7 @@ namespace NKAI { -#define MIN_AI_STRENGHT (0.5f) //lower when combat AI gets smarter +#define MIN_AI_STRENGTH (0.5f) //lower when combat AI gets smarter #define UNGUARDED_OBJECT (100.0f) //we consider unguarded objects 100 times weaker than us const float MIN_CRITICAL_VALUE = 2.0f; @@ -1000,7 +1000,7 @@ public: evaluationContext.goldReward += 7 * bi.dailyIncome[EGameResID::GOLD] / 2; // 7 day income but half we already have evaluationContext.heroRole = HeroRole::MAIN; evaluationContext.movementCostByRole[evaluationContext.heroRole] += bi.prerequisitesCount; - evaluationContext.goldCost += bi.buildCostWithPrerequisits[EGameResID::GOLD]; + evaluationContext.goldCost += bi.buildCostWithPrerequisites[EGameResID::GOLD]; evaluationContext.closestWayRatio = 1; if(bi.creatureID != CreatureID::NONE) diff --git a/AI/Nullkiller/Goals/BuyArmy.cpp b/AI/Nullkiller/Goals/BuyArmy.cpp index 9e2f52bff..861097eb8 100644 --- a/AI/Nullkiller/Goals/BuyArmy.cpp +++ b/AI/Nullkiller/Goals/BuyArmy.cpp @@ -34,13 +34,13 @@ void BuyArmy::accept(AIGateway * ai) ui64 valueBought = 0; //buy the stacks with largest AI value - auto upgradeSuccessfull = ai->makePossibleUpgrades(town); + auto upgradeSuccessful = ai->makePossibleUpgrades(town); auto armyToBuy = ai->nullkiller->armyManager->getArmyAvailableToBuy(town->getUpperArmy(), town); if(armyToBuy.empty()) { - if(upgradeSuccessfull) + if(upgradeSuccessful) return; throw cannotFulfillGoalException("No creatures to buy."); diff --git a/AI/Nullkiller/Goals/ExecuteHeroChain.cpp b/AI/Nullkiller/Goals/ExecuteHeroChain.cpp index d7b1025da..68a7375c6 100644 --- a/AI/Nullkiller/Goals/ExecuteHeroChain.cpp +++ b/AI/Nullkiller/Goals/ExecuteHeroChain.cpp @@ -234,7 +234,7 @@ void ExecuteHeroChain::accept(AIGateway * ai) if(node->turns == 0) { logAi->error( - "Unable to complete chain. Expected hero %s to arive to %s but he is at %s", + "Unable to complete chain. Expected hero %s to arrive to %s but he is at %s", hero->getNameTranslated(), node->coord.toString(), hero->visitablePos().toString()); diff --git a/AI/Nullkiller/Pathfinding/AINodeStorage.cpp b/AI/Nullkiller/Pathfinding/AINodeStorage.cpp index 254240df4..c6c9fee8b 100644 --- a/AI/Nullkiller/Pathfinding/AINodeStorage.cpp +++ b/AI/Nullkiller/Pathfinding/AINodeStorage.cpp @@ -27,8 +27,8 @@ namespace NKAI std::shared_ptr> AISharedStorage::shared; uint64_t AISharedStorage::version = 0; boost::mutex AISharedStorage::locker; -std::set commitedTiles; -std::set commitedTilesInitial; +std::set committedTiles; +std::set committedTilesInitial; const uint64_t FirstActorMask = 1; @@ -36,7 +36,7 @@ const uint64_t MIN_ARMY_STRENGTH_FOR_CHAIN = 5000; const uint64_t MIN_ARMY_STRENGTH_FOR_NEXT_ACTOR = 1000; const uint64_t CHAIN_MAX_DEPTH = 4; -const bool DO_NOT_SAVE_TO_COMMITED_TILES = false; +const bool DO_NOT_SAVE_TO_COMMITTED_TILES = false; AISharedStorage::AISharedStorage(int3 sizes) { @@ -94,7 +94,7 @@ void AIPathNode::addSpecialAction(std::shared_ptr action) AINodeStorage::AINodeStorage(const Nullkiller * ai, const int3 & Sizes) : sizes(Sizes), ai(ai), cb(ai->cb.get()), nodes(Sizes) { - accesibility = std::make_unique>( + accessibility = std::make_unique>( boost::extents[sizes.z][sizes.x][sizes.y][EPathfindingLayer::NUM_LAYERS]); dangerEvaluator.reset(new FuzzyHelper(ai)); @@ -157,7 +157,7 @@ void AINodeStorage::initialize(const PathfinderOptions & options, const CGameSta void AINodeStorage::clear() { actors.clear(); - commitedTiles.clear(); + committedTiles.clear(); heroChainPass = EHeroChainPass::INITIAL; heroChainTurn = 0; heroChainMaxTurns = 1; @@ -276,7 +276,7 @@ void AINodeStorage::commit( int turn, int movementLeft, float cost, - bool saveToCommited) const + bool saveToCommitted) const { destination->action = action; destination->setCost(cost); @@ -290,7 +290,7 @@ void AINodeStorage::commit( #if NKAI_PATHFINDER_TRACE_LEVEL >= 2 logAi->trace( - "Commited %s -> %s, layer: %d, cost: %f, turn: %s, mp: %d, hero: %s, mask: %x, army: %lld", + "Committed %s -> %s, layer: %d, cost: %f, turn: %s, mp: %d, hero: %s, mask: %x, army: %lld", source->coord.toString(), destination->coord.toString(), destination->layer, @@ -302,9 +302,9 @@ void AINodeStorage::commit( destination->actor->armyValue); #endif - if(saveToCommited && destination->turns <= heroChainTurn) + if(saveToCommitted && destination->turns <= heroChainTurn) { - commitedTiles.insert(destination->coord); + committedTiles.insert(destination->coord); } if(destination->turns == source->turns) @@ -376,7 +376,7 @@ bool AINodeStorage::increaseHeroChainTurnLimit() return false; heroChainTurn++; - commitedTiles.clear(); + committedTiles.clear(); for(auto layer : phisycalLayers) { @@ -386,7 +386,7 @@ bool AINodeStorage::increaseHeroChainTurnLimit() { if(node.turns <= heroChainTurn && node.action != EPathNodeAction::UNKNOWN) { - commitedTiles.insert(pos); + committedTiles.insert(pos); return true; } @@ -547,7 +547,7 @@ bool AINodeStorage::calculateHeroChain() heroChainPass = EHeroChainPass::CHAIN; heroChain.clear(); - std::vector data(commitedTiles.begin(), commitedTiles.end()); + std::vector data(committedTiles.begin(), committedTiles.end()); if(data.size() > 100) { @@ -578,7 +578,7 @@ bool AINodeStorage::calculateHeroChain() task.flushResult(heroChain); } - commitedTiles.clear(); + committedTiles.clear(); return !heroChain.empty(); } @@ -594,7 +594,7 @@ bool AINodeStorage::selectFirstActor() }); chainMask = strongest->chainMask; - commitedTilesInitial = commitedTiles; + committedTilesInitial = committedTiles; return true; } @@ -629,7 +629,7 @@ bool AINodeStorage::selectNextActor() return false; chainMask = nextActor->get()->chainMask; - commitedTiles = commitedTilesInitial; + committedTiles = committedTilesInitial; return true; } @@ -656,7 +656,7 @@ void HeroChainCalculationTask::cleanupInefectiveChains(std::vectortrace( - "Skip exchange %s[%x] -> %s[%x] at %s is ineficient", + "Skip exchange %s[%x] -> %s[%x] at %s is inefficient", chainInfo.otherParent->actor->toString(), chainInfo.otherParent->actor->chainMask, chainInfo.carrierParent->actor->toString(), @@ -756,7 +756,7 @@ void HeroChainCalculationTask::calculateHeroChain( if(hasLessMp && hasLessExperience) { #if NKAI_PATHFINDER_TRACE_LEVEL >= 2 - logAi->trace("Exchange at %s is ineficient. Blocked.", carrier->coord.toString()); + logAi->trace("Exchange at %s is inefficient. Blocked.", carrier->coord.toString()); #endif return; } @@ -825,7 +825,7 @@ void HeroChainCalculationTask::addHeroChain(const std::vector chainInfo.turns, chainInfo.moveRemains, chainInfo.getCost(), - DO_NOT_SAVE_TO_COMMITED_TILES); + DO_NOT_SAVE_TO_COMMITTED_TILES); if(carrier->specialAction || carrier->chainOther) { @@ -1119,7 +1119,7 @@ struct TownPortalFinder bestNode->turns, bestNode->moveRemains - movementNeeded, movementCost, - DO_NOT_SAVE_TO_COMMITED_TILES); + DO_NOT_SAVE_TO_COMMITTED_TILES); node->theNodeBefore = bestNode; node->addSpecialAction(std::make_shared(targetTown)); @@ -1281,7 +1281,7 @@ bool AINodeStorage::isOtherChainBetter( { #if NKAI_PATHFINDER_TRACE_LEVEL >= 2 logAi->trace( - "Block ineficient battle move %s->%s, hero: %s[%X], army %lld, mp diff: %i", + "Block inefficient battle move %s->%s, hero: %s[%X], army %lld, mp diff: %i", source->coord.toString(), candidateNode.coord.toString(), candidateNode.actor->hero->getNameTranslated(), @@ -1305,7 +1305,7 @@ bool AINodeStorage::isOtherChainBetter( { #if NKAI_PATHFINDER_TRACE_LEVEL >= 2 logAi->trace( - "Block ineficient move because of stronger army %s->%s, hero: %s[%X], army %lld, mp diff: %i", + "Block inefficient move because of stronger army %s->%s, hero: %s[%X], army %lld, mp diff: %i", source->coord.toString(), candidateNode.coord.toString(), candidateNode.actor->hero->getNameTranslated(), @@ -1331,7 +1331,7 @@ bool AINodeStorage::isOtherChainBetter( #if NKAI_PATHFINDER_TRACE_LEVEL >= 2 logAi->trace( - "Block ineficient move because of stronger hero %s->%s, hero: %s[%X], army %lld, mp diff: %i", + "Block inefficient move because of stronger hero %s->%s, hero: %s[%X], army %lld, mp diff: %i", source->coord.toString(), candidateNode.coord.toString(), candidateNode.actor->hero->getNameTranslated(), diff --git a/AI/Nullkiller/Pathfinding/AINodeStorage.h b/AI/Nullkiller/Pathfinding/AINodeStorage.h index 33455f350..5c160238d 100644 --- a/AI/Nullkiller/Pathfinding/AINodeStorage.h +++ b/AI/Nullkiller/Pathfinding/AINodeStorage.h @@ -165,7 +165,7 @@ class AINodeStorage : public INodeStorage private: int3 sizes; - std::unique_ptr> accesibility; + std::unique_ptr> accessibility; const CPlayerSpecificInfoCallback * cb; const Nullkiller * ai; @@ -214,7 +214,7 @@ public: int turn, int movementLeft, float cost, - bool saveToCommited = true) const; + bool saveToCommitted = true) const; inline const AIPathNode * getAINode(const CGPathNode * node) const { @@ -257,7 +257,7 @@ public: const AIPathNode & candidateNode, const AIPathNode & other) const; - bool isMovementIneficient(const PathNodeInfo & source, CDestinationNodeInfo & destination) const + bool isMovementInefficient(const PathNodeInfo & source, CDestinationNodeInfo & destination) const { return hasBetterChain(source, destination); } @@ -287,12 +287,12 @@ public: inline EPathAccessibility getAccessibility(const int3 & tile, EPathfindingLayer layer) const { - return (*this->accesibility)[tile.z][tile.x][tile.y][layer]; + return (*this->accessibility)[tile.z][tile.x][tile.y][layer]; } inline void resetTile(const int3 & tile, EPathfindingLayer layer, EPathAccessibility tileAccessibility) { - (*this->accesibility)[tile.z][tile.x][tile.y][layer] = tileAccessibility; + (*this->accessibility)[tile.z][tile.x][tile.y][layer] = tileAccessibility; } inline int getBucket(const ChainActor * actor) const diff --git a/AI/Nullkiller/Pathfinding/Rules/AILayerTransitionRule.cpp b/AI/Nullkiller/Pathfinding/Rules/AILayerTransitionRule.cpp index f38286ee0..8d95d6224 100644 --- a/AI/Nullkiller/Pathfinding/Rules/AILayerTransitionRule.cpp +++ b/AI/Nullkiller/Pathfinding/Rules/AILayerTransitionRule.cpp @@ -164,7 +164,7 @@ namespace AIPathfinding if(hero->canCastThisSpell(summonBoatSpell) && hero->getSpellSchoolLevel(summonBoatSpell) >= MasteryLevel::ADVANCED) { - // TODO: For lower school level we might need to check the existance of some boat + // TODO: For lower school level we might need to check the existence of some boat summonableVirtualBoats[hero] = std::make_shared(); } } diff --git a/AI/Nullkiller/Pathfinding/Rules/AIMovementAfterDestinationRule.cpp b/AI/Nullkiller/Pathfinding/Rules/AIMovementAfterDestinationRule.cpp index 2acfe0bd9..34f4f2766 100644 --- a/AI/Nullkiller/Pathfinding/Rules/AIMovementAfterDestinationRule.cpp +++ b/AI/Nullkiller/Pathfinding/Rules/AIMovementAfterDestinationRule.cpp @@ -34,7 +34,7 @@ namespace AIPathfinding const PathfinderConfig * pathfinderConfig, CPathfinderHelper * pathfinderHelper) const { - if(nodeStorage->isMovementIneficient(source, destination)) + if(nodeStorage->isMovementInefficient(source, destination)) { destination.node->locked = true; destination.blocked = true; diff --git a/AI/VCAI/Goals/BuildThis.cpp b/AI/VCAI/Goals/BuildThis.cpp index 378db7283..0c85f5049 100644 --- a/AI/VCAI/Goals/BuildThis.cpp +++ b/AI/VCAI/Goals/BuildThis.cpp @@ -41,7 +41,7 @@ TSubgoal BuildThis::whatToDoToAchieve() { case EBuildingState::ALLOWED: town = candidateTown; - break; //TODO: look for prerequisites? this is not our reponsibility + break; //TODO: look for prerequisites? this is not our responsibility default: continue; } diff --git a/AI/VCAI/Goals/ClearWayTo.cpp b/AI/VCAI/Goals/ClearWayTo.cpp index ddea93732..328c4711d 100644 --- a/AI/VCAI/Goals/ClearWayTo.cpp +++ b/AI/VCAI/Goals/ClearWayTo.cpp @@ -73,7 +73,7 @@ TGoalVec ClearWayTo::getAllPossibleSubgoals() if(ret.empty()) { logAi->warn("There is no known way to clear the way to tile %s", tile.toString()); - throw goalFulfilledException(sptr(ClearWayTo(tile))); //make sure asigned hero gets unlocked + throw goalFulfilledException(sptr(ClearWayTo(tile))); //make sure assigned hero gets unlocked } return ret; diff --git a/AI/VCAI/Goals/VisitHero.cpp b/AI/VCAI/Goals/VisitHero.cpp index 5e57743fd..8f75ea636 100644 --- a/AI/VCAI/Goals/VisitHero.cpp +++ b/AI/VCAI/Goals/VisitHero.cpp @@ -53,7 +53,7 @@ TSubgoal VisitHero::whatToDoToAchieve() bool VisitHero::fulfillsMe(TSubgoal goal) { - //TODO: VisitObj shoudl not be used for heroes, but... + //TODO: VisitObj should not be used for heroes, but... if(goal->goalType == VISIT_TILE) { auto obj = cb->getObj(ObjectInstanceID(objid)); diff --git a/AI/VCAI/Goals/Win.cpp b/AI/VCAI/Goals/Win.cpp index d2ab613e3..01ec05c7a 100644 --- a/AI/VCAI/Goals/Win.cpp +++ b/AI/VCAI/Goals/Win.cpp @@ -74,7 +74,7 @@ TSubgoal Win::whatToDoToAchieve() case EventCondition::HAVE_BUILDING: { // TODO build other buildings apart from Grail - // goal.objectType = buidingID to build + // goal.objectType = buildingID to build // goal.object = optional, town in which building should be built // Represents "Improve town" condition from H3 (but unlike H3 it consists from 2 separate conditions) diff --git a/AI/VCAI/Pathfinding/AINodeStorage.cpp b/AI/VCAI/Pathfinding/AINodeStorage.cpp index b3b817c76..80d476fa7 100644 --- a/AI/VCAI/Pathfinding/AINodeStorage.cpp +++ b/AI/VCAI/Pathfinding/AINodeStorage.cpp @@ -309,7 +309,7 @@ bool AINodeStorage::hasBetterChain(const PathNodeInfo & source, CDestinationNode { #ifdef VCMI_TRACE_PATHFINDER logAi->trace( - "Block ineficient move %s:->%s, mask=%i, mp diff: %i", + "Block inefficient move %s:->%s, mask=%i, mp diff: %i", source.coord.toString(), destination.coord.toString(), destinationNode->chainMask, diff --git a/AI/VCAI/Pathfinding/Rules/AILayerTransitionRule.cpp b/AI/VCAI/Pathfinding/Rules/AILayerTransitionRule.cpp index 4e857df98..d7b044ffd 100644 --- a/AI/VCAI/Pathfinding/Rules/AILayerTransitionRule.cpp +++ b/AI/VCAI/Pathfinding/Rules/AILayerTransitionRule.cpp @@ -79,7 +79,7 @@ namespace AIPathfinding if(hero->canCastThisSpell(summonBoatSpell) && hero->getSpellSchoolLevel(summonBoatSpell) >= MasteryLevel::ADVANCED) { - // TODO: For lower school level we might need to check the existance of some boat + // TODO: For lower school level we might need to check the existence of some boat summonableVirtualBoat.reset(new SummonBoatAction()); } } diff --git a/AI/VCAI/ResourceManager.cpp b/AI/VCAI/ResourceManager.cpp index b69c4e9bc..e8f9b75ce 100644 --- a/AI/VCAI/ResourceManager.cpp +++ b/AI/VCAI/ResourceManager.cpp @@ -66,7 +66,7 @@ TResources ResourceManager::estimateIncome() const return ret; } -void ResourceManager::reserveResoures(const TResources & res, Goals::TSubgoal goal) +void ResourceManager::reserveResources(const TResources & res, Goals::TSubgoal goal) { if (!goal->invalid()) tryPush(ResourceObjective(res, goal)); @@ -315,7 +315,7 @@ bool ResourceManager::removeOutdatedObjectives(std::functiongetResourceAmount(); - myRes -= reservedResources(); //substract the value of reserved goals + myRes -= reservedResources(); //subtract the value of reserved goals for (auto & val : myRes) vstd::amax(val, 0); //never negative diff --git a/AI/VCAI/ResourceManager.h b/AI/VCAI/ResourceManager.h index e920746b7..62ef1a404 100644 --- a/AI/VCAI/ResourceManager.h +++ b/AI/VCAI/ResourceManager.h @@ -24,7 +24,7 @@ struct DLL_EXPORT ResourceObjective ResourceObjective(const TResources &res, Goals::TSubgoal goal); bool operator < (const ResourceObjective &ro) const; - TResources resources; //how many resoures do we need + TResources resources; //how many resources do we need Goals::TSubgoal goal; //what for (build, gather army etc...) }; @@ -79,7 +79,7 @@ public: bool notifyGoalCompleted(Goals::TSubgoal goal) override; protected: //not-const actions only for AI - virtual void reserveResoures(const TResources & res, Goals::TSubgoal goal = Goals::TSubgoal()); + virtual void reserveResources(const TResources & res, Goals::TSubgoal goal = Goals::TSubgoal()); virtual bool updateGoal(Goals::TSubgoal goal); //new goal must have same properties but different priority virtual bool tryPush(const ResourceObjective &o); diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index f2f62853f..d9315aef9 100644 --- a/AI/VCAI/VCAI.cpp +++ b/AI/VCAI/VCAI.cpp @@ -571,7 +571,7 @@ void VCAI::objectPropertyChanged(const SetObjectProperty * sop) auto obj = myCb->getObj(sop->id, false); if(obj) { - addVisitableObj(obj); // TODO: Remove once save compatability broken. In past owned objects were removed from this set + addVisitableObj(obj); // TODO: Remove once save compatibility broken. In past owned objects were removed from this set vstd::erase_if_present(alreadyVisited, obj); } } @@ -682,7 +682,7 @@ void VCAI::showTeleportDialog(const CGHeroInstance * hero, TeleportChannelID cha status.addQuery(askID, boost::str(boost::format("Teleport dialog query with %d exits") % exits.size())); - int choosenExit = -1; + int chosenExit = -1; if(impassable) { knownTeleportChannels[channel]->passability = TeleportChannel::IMPASSABLE; @@ -691,14 +691,14 @@ void VCAI::showTeleportDialog(const CGHeroInstance * hero, TeleportChannelID cha { auto neededExit = std::make_pair(destinationTeleport, destinationTeleportPos); if(destinationTeleport != ObjectInstanceID() && vstd::contains(exits, neededExit)) - choosenExit = vstd::find_pos(exits, neededExit); + chosenExit = vstd::find_pos(exits, neededExit); } for(auto exit : exits) { if(status.channelProbing() && exit.first == destinationTeleport) { - choosenExit = vstd::find_pos(exits, exit); + chosenExit = vstd::find_pos(exits, exit); break; } else @@ -716,7 +716,7 @@ void VCAI::showTeleportDialog(const CGHeroInstance * hero, TeleportChannelID cha requestActionASAP([=]() { - answerQuery(askID, choosenExit); + answerQuery(askID, chosenExit); }); } @@ -942,7 +942,7 @@ void VCAI::mainLoop() while (possibleGoals.size()) { //allow assign goals to heroes with 0 movement, but don't realize them - //maybe there are beter ones left + //maybe there are better ones left auto bestGoal = fh->chooseSolution(possibleGoals); if (bestGoal->hero) //lock this hero to fulfill goal @@ -1543,7 +1543,7 @@ void VCAI::completeGoal(Goals::TSubgoal goal) auto it = lockedHeroes.find(h); if(it != lockedHeroes.end()) { - if(it->second == goal || it->second->fulfillsMe(goal)) //FIXME this is overspecified, fulfillsMe shoudl be complete + if(it->second == goal || it->second->fulfillsMe(goal)) //FIXME this is overspecified, fulfillsMe should be complete { logAi->debug(goal->completeMessage()); lockedHeroes.erase(it); //goal fulfilled, free hero @@ -1735,7 +1735,7 @@ const CGObjectInstance * VCAI::lookForArt(ArtifactID aid) const return nullptr; - //TODO what if more than one artifact is available? return them all or some slection criteria + //TODO what if more than one artifact is available? return them all or some selection criteria } bool VCAI::isAccessible(const int3 & pos) const @@ -2110,7 +2110,7 @@ void VCAI::tryRealize(Goals::Trade & g) //trade if(ah->freeResources()[g.resID] >= g.value) //goal is already fulfilled. Why we need this check, anyway? throw goalFulfilledException(sptr(g)); - int accquiredResources = 0; + int acquiredResources = 0; if(const CGObjectInstance * obj = cb->getObj(ObjectInstanceID(g.objid), false)) { if(const auto * m = dynamic_cast(obj)) @@ -2130,8 +2130,8 @@ void VCAI::tryRealize(Goals::Trade & g) //trade if (toGive) //don't try to sell 0 resources { cb->trade(m, EMarketMode::RESOURCE_RESOURCE, res, GameResID(g.resID), toGive); - accquiredResources = static_cast(toGet * (it->resVal / toGive)); - logAi->debug("Traded %d of %s for %d of %s at %s", toGive, res, accquiredResources, g.resID, obj->getObjectName()); + acquiredResources = static_cast(toGet * (it->resVal / toGive)); + logAi->debug("Traded %d of %s for %d of %s at %s", toGive, res, acquiredResources, g.resID, obj->getObjectName()); } if (ah->freeResources()[g.resID] >= g.value) throw goalFulfilledException(sptr(g)); //we traded all we needed diff --git a/AI/VCAI/VCAI.h b/AI/VCAI/VCAI.h index e209c7850..089c33808 100644 --- a/AI/VCAI/VCAI.h +++ b/AI/VCAI/VCAI.h @@ -83,7 +83,7 @@ public: //std::vector visitedThisWeek; //only OPWs std::map> townVisitsThisWeek; - //part of mainLoop, but accessible from outisde + //part of mainLoop, but accessible from outside std::vector basicGoals; Goals::TGoalVec goalsToRemove; Goals::TGoalVec goalsToAdd; diff --git a/CCallback.h b/CCallback.h index 17cbf12fb..cad5871d0 100644 --- a/CCallback.h +++ b/CCallback.h @@ -69,7 +69,7 @@ public: //hero virtual void moveHero(const CGHeroInstance *h, const std::vector & path, bool transit) =0; //moves hero alongside provided path virtual void moveHero(const CGHeroInstance *h, const int3 & destination, bool transit) =0; //moves hero alongside provided path - virtual bool dismissHero(const CGHeroInstance * hero)=0; //dismisses given hero; true - successfuly, false - not successfuly + virtual bool dismissHero(const CGHeroInstance * hero)=0; //dismisses given hero; true - successfully, false - not successfully virtual void dig(const CGObjectInstance *hero)=0; virtual void castSpell(const CGHeroInstance *hero, SpellID spellID, const int3 &pos = int3(-1, -1, -1))=0; //cast adventure map spell diff --git a/CI/NSIS.template.in b/CI/NSIS.template.in index 55b10a03d..2d1e67966 100644 --- a/CI/NSIS.template.in +++ b/CI/NSIS.template.in @@ -486,15 +486,15 @@ Done: Exch $R1 FunctionEnd -Function ConditionalAddToRegisty +Function ConditionalAddToRegistry Pop $0 Pop $1 - StrCmp "$0" "" ConditionalAddToRegisty_EmptyString + StrCmp "$0" "" ConditionalAddToRegistry_EmptyString WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" \ "$1" "$0" ;MessageBox MB_OK "Set Registry: '$1' to '$0'" DetailPrint "Set install registry entry: '$1' to '$0'" - ConditionalAddToRegisty_EmptyString: + ConditionalAddToRegistry_EmptyString: FunctionEnd ;-------------------------------- @@ -646,44 +646,44 @@ Section "-Core installation" WriteUninstaller "$INSTDIR\Uninstall.exe" Push "DisplayName" Push "@CPACK_NSIS_DISPLAY_NAME@" - Call ConditionalAddToRegisty + Call ConditionalAddToRegistry Push "DisplayVersion" Push "@CPACK_PACKAGE_VERSION@" - Call ConditionalAddToRegisty + Call ConditionalAddToRegistry Push "Publisher" Push "@CPACK_PACKAGE_VENDOR@" - Call ConditionalAddToRegisty + Call ConditionalAddToRegistry Push "UninstallString" Push "$INSTDIR\Uninstall.exe" - Call ConditionalAddToRegisty + Call ConditionalAddToRegistry Push "NoRepair" Push "1" - Call ConditionalAddToRegisty + Call ConditionalAddToRegistry !ifdef CPACK_NSIS_ADD_REMOVE ;Create add/remove functionality Push "ModifyPath" Push "$INSTDIR\AddRemove.exe" - Call ConditionalAddToRegisty + Call ConditionalAddToRegistry !else Push "NoModify" Push "1" - Call ConditionalAddToRegisty + Call ConditionalAddToRegistry !endif ; Optional registration Push "DisplayIcon" Push "$INSTDIR\@CPACK_NSIS_INSTALLED_ICON_NAME@" - Call ConditionalAddToRegisty + Call ConditionalAddToRegistry Push "HelpLink" Push "@CPACK_NSIS_HELP_LINK@" - Call ConditionalAddToRegisty + Call ConditionalAddToRegistry Push "URLInfoAbout" Push "@CPACK_NSIS_URL_INFO_ABOUT@" - Call ConditionalAddToRegisty + Call ConditionalAddToRegistry Push "Contact" Push "@CPACK_NSIS_CONTACT@" - Call ConditionalAddToRegisty + Call ConditionalAddToRegistry !insertmacro MUI_INSTALLOPTIONS_READ $INSTALL_DESKTOP "NSIS.InstallOptions.ini" "Field 5" "State" !insertmacro MUI_STARTMENU_WRITE_BEGIN Application @@ -701,19 +701,19 @@ Section "-Core installation" ; Write special uninstall registry entries Push "StartMenu" Push "$STARTMENU_FOLDER" - Call ConditionalAddToRegisty + Call ConditionalAddToRegistry Push "DoNotAddToPath" Push "$DO_NOT_ADD_TO_PATH" - Call ConditionalAddToRegisty + Call ConditionalAddToRegistry Push "AddToPathAllUsers" Push "$ADD_TO_PATH_ALL_USERS" - Call ConditionalAddToRegisty + Call ConditionalAddToRegistry Push "AddToPathCurrentUser" Push "$ADD_TO_PATH_CURRENT_USER" - Call ConditionalAddToRegisty + Call ConditionalAddToRegistry Push "InstallToDesktop" Push "$INSTALL_DESKTOP" - Call ConditionalAddToRegisty + Call ConditionalAddToRegistry !insertmacro MUI_STARTMENU_WRITE_END @@ -848,7 +848,7 @@ Section "Uninstall" @CPACK_NSIS_DELETE_ICONS@ @CPACK_NSIS_DELETE_ICONS_EXTRA@ - ;Delete empty start menu parent diretories + ;Delete empty start menu parent directories StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" startMenuDeleteLoop: @@ -867,7 +867,7 @@ Section "Uninstall" Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" @CPACK_NSIS_DELETE_ICONS_EXTRA@ - ;Delete empty start menu parent diretories + ;Delete empty start menu parent directories StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" secondStartMenuDeleteLoop: diff --git a/CMakeLists.txt b/CMakeLists.txt index 00a101324..4f6eda5ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ # Minimum required version greatly affect CMake behavior # So cmake_minimum_required must be called before the project() -# 3.16.0 is used since it's used by our currently oldest suppored system: Ubuntu-20.04 +# 3.16.0 is used since it's used by our currently oldest supported system: Ubuntu-20.04 cmake_minimum_required(VERSION 3.16.0) project(VCMI) diff --git a/ChangeLog.md b/ChangeLog.md index 386f6f012..9ed76c11e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -40,7 +40,7 @@ * Fixed wrong order of activating mods in chain when installing multiple mods at once * Mod list no longer shows mod version column. Version is now only shown in the mod description. * Launcher will now skip the Heroes 3 data import step if data has been found automatically -* Fixed inport of existing data files on iOS. This option now requires iOS 13 or later +* Fixed import of existing data files on iOS. This option now requires iOS 13 or later * Fixed import using offline installer on iOS. * Buttons to open data directories in the Help tab are now hidden on mobile systems if they can't be opened with file browser * Added the configuration files directory to the Help tab as it is located separately on Linux systems @@ -321,7 +321,7 @@ ### Battles * Added option to enable unlimited combat replays during game setup -* Added option to instantly end battle using quick combat (shotcut: 'e') +* Added option to instantly end battle using quick combat (shortcut: 'e') * Added option to replace auto-combat button action with instant end using quick combat * Battles against AI players can now be done using quick combat * Disabling battle queue will now correctly reposition hero statistics preview popup @@ -885,7 +885,7 @@ ### GENERAL: * Fixed framerate drops on hero movement with active hota mod * Fade-out animations will now be skipped when instant hero movement speed is used -* Restarting loaded campaing scenario will now correctly reapply starting bonus +* Restarting loaded campaign scenario will now correctly reapply starting bonus * Reverted FPS limit on mobile systems back to 60 fps * Fixed loading of translations for maps and campaigns * Fixed loading of preconfigured starting army for heroes with preconfigured spells @@ -1051,7 +1051,7 @@ * Battle opening sound can now be skipped with mouse click * Fixed movement through moat of double-hexed units * Fixed removal of Land Mines and Fire Walls -* Obstacles will now corectly show up either below or above unit +* Obstacles will now correctly show up either below or above unit * It is now possible to teleport a unit through destroyed walls * Added distinct overlay image for showing movement range of highlighted unit * Added overlay for displaying shooting range penalties of units @@ -1171,7 +1171,7 @@ * RMG will no longer place shipyards or boats at very small lakes * Fixed placement of shipyards in invalid locations * Fixed potential game hang on generation of random map -* RMG will now generate addditional monolith pairs to create required number of zone connections +* RMG will now generate additional monolith pairs to create required number of zone connections * RMG will try to place Subterranean Gates as far away from other objects (including each other) as possible * RMG will now try to place objects as far as possible in both zones sharing a guard, not only the first one. * Use only one template for an object in zone @@ -1195,7 +1195,7 @@ * Added option to show amount of creatures as numeric range rather than adjective * Added option to show map grid * Map swipe is no longer exclusive for phones and can be enabled on desktop platforms -* Added more graduated settigns for hero movement speed +* Added more graduated settings for hero movement speed * Map scrolling is now more graduated and scrolls with pixel-level precision * Hero movement speed now matches H3 * Improved performance of adventure map rendering @@ -1214,7 +1214,7 @@ * Fixed white status bar on server connection screen * Buttons in battle window now correctly show tooltip in status bar * Fixed cursor image during enemy turn in combat -* Game will no longer promt to assemble artifacts if they fall into backpack +* Game will no longer prompt to assemble artifacts if they fall into backpack * It is now possible to use in-game console for vcmi commands * Stacks sized 1000-9999 units will not be displayed as "1k" * It is now possible to select destination town for Town Portal via double-click @@ -1300,7 +1300,7 @@ * Dragon Breath attack now correctly uses different attack animation if multiple targets are hit * Petrification: implemented visual effect * Paralyze: added visual effect -* Blind: Stacks will no longer retailate on attack that blinds them +* Blind: Stacks will no longer retaliate on attack that blinds them * Demon Summon: Added animation effect for summoning * Fire shield will no longer trigger on non-adjacent attacks, e.g. from Dragon Breath * Weakness now has correct visual effect @@ -1479,7 +1479,7 @@ * treasury ### SOUND: -* Fixed many mising or wrong pickup and visit sounds for map objects +* Fixed many missing or wrong pickup and visit sounds for map objects * All map objects now have ambient sounds identical to OH3 ### RANDOM MAP GENERATOR: @@ -1532,7 +1532,7 @@ * New console commands: * gosolo - AI take control over human players and vice versa * controlai - give control of one or all AIs to player - * set hideSystemMessages on/off - supress server messages in chat + * set hideSystemMessages on/off - suppress server messages in chat ### BATTLES: * Drawbridge mechanics implemented (animation still missing) @@ -1574,7 +1574,7 @@ * View Earth * Visions * Disguise -* Implemented CURE spell negative dispell effect +* Implemented CURE spell negative dispel effect * Added LOCATION target for spells castable on any hex with new target modifiers ### BATTLES: @@ -1597,7 +1597,7 @@ * VCMI can now be compiled with SDL2 * Movies will use ffmpeg library * change boost::bind to std::bind - * removed boost::asign + * removed boost::assign * Updated FuzzyLite to 5.0 * Multiplayer load support was implemented through command-line options @@ -1646,7 +1646,7 @@ * Zone placement * Zone borders and connections, fractalized paths inside zones * Guard generation -* Treasue piles generation (so far only few removable objects) +* Treasure piles generation (so far only few removable objects) ### MODS: * Support for submods - mod may have their own "submods" located in /Mods directory @@ -1753,7 +1753,7 @@ * Improved json validation. Now it support most of features from latest json schema draft. * Icons use path to icon instead of image indexes. * It is possible to edit data of another mod or H3 data via mods. -* Mods can access only ID's from dependenies, virtual "core" mod and itself (optional for some mods compatibility) +* Mods can access only ID's from dependencies, virtual "core" mod and itself (optional for some mods compatibility) * Removed no longer needed field "projectile spins" * Heroes: split heroes.json in manner similar to creatures\factions; string ID's for H3 heroes; h3 hero classes and artifacts can be modified via json. @@ -1870,7 +1870,7 @@ * Fixed a possible freeze when exchanging resources at marketplace ### BATTLE AI: -* It is possible to select a battle AI module used by VCMI by typing into the console "setBattleAI ". The names of avaialble modules are "StupidAI" and "BattleAI". BattleAI may be a little smarter but less stable. By the default, StupidAI will be used, as in previous releases. +* It is possible to select a battle AI module used by VCMI by typing into the console "setBattleAI ". The names of available modules are "StupidAI" and "BattleAI". BattleAI may be a little smarter but less stable. By the default, StupidAI will be used, as in previous releases. * New battle AI module: "BattleAI" that is smarter and capable of casting some offensive and enchantment spells # 0.88 -> 0.89 (Jun 01 2012) @@ -1963,7 +1963,7 @@ * No wall penalty * Enchanter * Bind - * Dispell helpful spells + * Dispel helpful spells # 0.85 -> 0.86 (Sep 01 2011) @@ -2085,7 +2085,7 @@ * Spell damage specialities (Deemer), fixed bonus (Ciele) * Secondary skill bonuses * Creature Upgrades (Gelu) - * Resorce generation + * Resource generation * Starting Skill (Adrienne) ### TOWNS: @@ -2224,7 +2224,7 @@ http://bugs.vcmi.eu/changelog_page.php?version_id=14 * Clicking on the border no longer opens an empty info windows ### HERO WINDOW: -* Improved artifact moving. Available slots are higlighted. Moved artifact is bound to mouse cursor. +* Improved artifact moving. Available slots are highlighted. Moved artifact is bound to mouse cursor. ### TOWNS: * new special town structures supported: @@ -2237,7 +2237,7 @@ http://bugs.vcmi.eu/changelog_page.php?version_id=14 ### OBJECTS: * External dwellings increase town growth * Right-click info window for castles and garrisons you do not own shows a rough amount of creatures instead of none -* Scholar won't give unavaliable spells anymore. +* Scholar won't give unavailable spells anymore. A lot of of various bugfixes and improvements: http://bugs.vcmi.eu/changelog_page.php?version_id=2 @@ -2257,7 +2257,7 @@ http://bugs.vcmi.eu/changelog_page.php?version_id=2 * a few fixes for shipyard window ### ADVENTURE INTERFACE: -* Cursor shows if tile is accesible and how many turns away +* Cursor shows if tile is accessible and how many turns away * moving hero with arrow keys / numpad * fixed Next Hero button behaviour * fixed Surface/Underground switch button in higher resolutions @@ -2426,7 +2426,7 @@ http://bugs.vcmi.eu/changelog_page.php?version_id=2 * Diplomacy secondary skill support * timed events won't cause resources amount to be negative * support for sorcery secondary skill -* reduntant quotation marks from artifact descriptions are removed +* redundant quotation marks from artifact descriptions are removed * no income at the first day ### ADVENTURE INTERFACE: @@ -2954,7 +2954,7 @@ And a lot of minor fixes * [feature] picked artifacts are added to hero's backpack * [feature] possibility of choosing player to play * [bugfix] ZELP.TXT file *should* be handled correctly even it is non-english -* [bugfix] fixed crashbug in reading defs with negativ left/right margins +* [bugfix] fixed crashbug in reading defs with negative left/right margins * [bugfix] improved randomization * [bugfix] pathfinder can't be cheated (what caused errors) diff --git a/android/vcmi-app/src/main/java/org/libsdl/app/SDLActivity.java b/android/vcmi-app/src/main/java/org/libsdl/app/SDLActivity.java index 9bc864fc2..649fb1e74 100644 --- a/android/vcmi-app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/android/vcmi-app/src/main/java/org/libsdl/app/SDLActivity.java @@ -89,7 +89,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh | InputDevice.SOURCE_CLASS_POSITION | InputDevice.SOURCE_CLASS_TRACKBALL); - if (s2 != 0) cls += "Some_Unkown"; + if (s2 != 0) cls += "Some_Unknown"; s2 = s_copy & InputDevice.SOURCE_ANY; // keep source only, no class; @@ -163,7 +163,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh if (s == FLAG_TAINTED) src += " FLAG_TAINTED"; s2 &= ~FLAG_TAINTED; - if (s2 != 0) src += " Some_Unkown"; + if (s2 != 0) src += " Some_Unknown"; Log.v(TAG, prefix + "int=" + s_copy + " CLASS={" + cls + " } source(s):" + src); } diff --git a/client/CGameInfo.h b/client/CGameInfo.h index 08e649825..7b9a4c884 100644 --- a/client/CGameInfo.h +++ b/client/CGameInfo.h @@ -55,7 +55,7 @@ public: extern CClientState * CCS; /// CGameInfo class -/// for allowing different functions for accessing game informations +/// for allowing different functions for accessing game information class CGameInfo final : public Services { public: diff --git a/client/CMT.cpp b/client/CMT.cpp index f3a1d6c09..b9862ef91 100644 --- a/client/CMT.cpp +++ b/client/CMT.cpp @@ -282,7 +282,7 @@ int main(int argc, char * argv[]) GH.init(); CCS = new CClientState(); - CGI = new CGameInfo(); //contains all global informations about game (texts, lodHandlers, map handler etc.) + CGI = new CGameInfo(); //contains all global information about game (texts, lodHandlers, map handler etc.) CSH = new CServerHandler(); // Initialize video @@ -525,7 +525,7 @@ void handleQuit(bool ask) void handleFatalError(const std::string & message, bool terminate) { - logGlobal->error("FATAL ERROR ENCOUTERED, VCMI WILL NOW TERMINATE"); + logGlobal->error("FATAL ERROR ENCOUNTERED, VCMI WILL NOW TERMINATE"); logGlobal->error("Reason: %s", message); std::string messageToShow = "Fatal error! " + message; diff --git a/client/CMT.h b/client/CMT.h index 28d877875..1bf25fd73 100644 --- a/client/CMT.h +++ b/client/CMT.h @@ -22,6 +22,6 @@ extern SDL_Surface *screenBuf; // points to screen (if only advmapint is present void handleQuit(bool ask = true); -/// Notify user about encoutered fatal error and terminate the game +/// Notify user about encountered fatal error and terminate the game /// TODO: decide on better location for this method [[noreturn]] void handleFatalError(const std::string & message, bool terminate); diff --git a/client/CPlayerInterface.h b/client/CPlayerInterface.h index 2919cf569..25f671864 100644 --- a/client/CPlayerInterface.h +++ b/client/CPlayerInterface.h @@ -142,7 +142,7 @@ protected: // Call-ins from server, should not be called directly, but only via void objectRemovedAfter() override; void playerBlocked(int reason, bool start) override; void gameOver(PlayerColor player, const EVictoryLossCheckResult & victoryLossCheckResult) override; - void playerStartsTurn(PlayerColor player) override; //called before yourTurn on active itnerface + void playerStartsTurn(PlayerColor player) override; //called before yourTurn on active interface void playerEndsTurn(PlayerColor player) override; void showWorldViewEx(const std::vector & objectPositions, bool showTerrain) override; diff --git a/client/ClientCommandManager.h b/client/ClientCommandManager.h index 56bd4619e..63c5a96dd 100644 --- a/client/ClientCommandManager.h +++ b/client/ClientCommandManager.h @@ -66,7 +66,7 @@ class ClientCommandManager //take mantis #2292 issue about account if thinking a // Export file into Extracted directory void handleExtractCommand(std::istringstream& singleWordBuffer); - // Print in console the current bonuses for curent army + // Print in console the current bonuses for current army void handleBonusesCommand(std::istringstream & singleWordBuffer); // Get what artifact is present on artifact slot with specified ID for hero with specified ID diff --git a/client/NetPacksClient.cpp b/client/NetPacksClient.cpp index 6789486d0..083df1c71 100644 --- a/client/NetPacksClient.cpp +++ b/client/NetPacksClient.cpp @@ -118,7 +118,7 @@ void callBattleInterfaceIfPresentForBothSides(CClient & cl, const BattleID & bat void ApplyClientNetPackVisitor::visitSetResources(SetResources & pack) { - //todo: inform on actual resource set transfered + //todo: inform on actual resource set transferred callInterfaceIfPresent(cl, pack.player, &IGameEventsReceiver::receivedResource); } @@ -844,7 +844,7 @@ void ApplyFirstClientNetPackVisitor::visitBattleAttack(BattleAttack & pack) { callBattleInterfaceIfPresentForBothSides(cl, pack.battleID, &IBattleEventsReceiver::battleAttack, pack.battleID, &pack); - // battleStacksAttacked should be excuted before BattleAttack.applyGs() to play animation before damaging unit + // battleStacksAttacked should be executed before BattleAttack.applyGs() to play animation before damaging unit // so this has to be here instead of ApplyClientNetPackVisitor::visitBattleAttack() callBattleInterfaceIfPresentForBothSides(cl, pack.battleID, &IBattleEventsReceiver::battleStacksAttacked, pack.battleID, pack.bsa, pack.shot()); } diff --git a/client/adventureMap/CInGameConsole.cpp b/client/adventureMap/CInGameConsole.cpp index 28a01fd32..02181d2ee 100644 --- a/client/adventureMap/CInGameConsole.cpp +++ b/client/adventureMap/CInGameConsole.cpp @@ -221,7 +221,7 @@ void CInGameConsole::keyPressed (EShortcut key) } } -void CInGameConsole::textInputed(const std::string & inputtedText) +void CInGameConsole::textInputted(const std::string & inputtedText) { if (LOCPLINT->cingconsole != this) return; diff --git a/client/adventureMap/CInGameConsole.h b/client/adventureMap/CInGameConsole.h index 89bba9aa8..39030f9e3 100644 --- a/client/adventureMap/CInGameConsole.h +++ b/client/adventureMap/CInGameConsole.h @@ -50,7 +50,7 @@ public: void show(Canvas & to) override; void showAll(Canvas & to) override; void keyPressed(EShortcut key) override; - void textInputed(const std::string & enteredText) override; + void textInputted(const std::string & enteredText) override; void textEdited(const std::string & enteredText) override; bool captureThisKey(EShortcut key) override; diff --git a/client/adventureMap/CList.cpp b/client/adventureMap/CList.cpp index c535e80cf..976476365 100644 --- a/client/adventureMap/CList.cpp +++ b/client/adventureMap/CList.cpp @@ -380,7 +380,7 @@ std::shared_ptr CTownList::CTownItem::genSelection() void CTownList::CTownItem::update() { - size_t iconIndex = town->town->clientInfo.icons[town->hasFort()][town->builded >= CGI->settings()->getInteger(EGameSettings::TOWNS_BUILDINGS_PER_TURN_CAP)]; + size_t iconIndex = town->town->clientInfo.icons[town->hasFort()][town->built >= CGI->settings()->getInteger(EGameSettings::TOWNS_BUILDINGS_PER_TURN_CAP)]; picture->setFrame(iconIndex + 2); redraw(); diff --git a/client/adventureMap/CMinimap.cpp b/client/adventureMap/CMinimap.cpp index bdc142e01..91de1edda 100644 --- a/client/adventureMap/CMinimap.cpp +++ b/client/adventureMap/CMinimap.cpp @@ -92,9 +92,9 @@ CMinimap::CMinimap(const Rect & position) { OBJECT_CONSTRUCTION_CAPTURING(255-DISPOSE); - double maxSideLenghtSrc = std::max(LOCPLINT->cb->getMapSize().x, LOCPLINT->cb->getMapSize().y); - double maxSideLenghtDst = std::max(position.w, position.h); - double resize = maxSideLenghtSrc / maxSideLenghtDst; + double maxSideLengthSrc = std::max(LOCPLINT->cb->getMapSize().x, LOCPLINT->cb->getMapSize().y); + double maxSideLengthDst = std::max(position.w, position.h); + double resize = maxSideLengthSrc / maxSideLengthDst; Point newMinimapSize = Point(LOCPLINT->cb->getMapSize().x/ resize, LOCPLINT->cb->getMapSize().y / resize); Point offset = Point((std::max(newMinimapSize.x, newMinimapSize.y) - newMinimapSize.x) / 2, (std::max(newMinimapSize.x, newMinimapSize.y) - newMinimapSize.y) / 2); diff --git a/client/battle/BattleActionsController.h b/client/battle/BattleActionsController.h index 3c9b35660..5b46b0bcb 100644 --- a/client/battle/BattleActionsController.h +++ b/client/battle/BattleActionsController.h @@ -120,6 +120,6 @@ public: const std::vector & getPossibleActions() const; void removePossibleAction(PossiblePlayerBattleAction); - /// inserts possible action in the beggining in order to prioritize it + /// inserts possible action in the beginning in order to prioritize it void pushFrontPossibleAction(PossiblePlayerBattleAction); }; diff --git a/client/battle/BattleAnimationClasses.cpp b/client/battle/BattleAnimationClasses.cpp index 78bfcadfa..c54a1d202 100644 --- a/client/battle/BattleAnimationClasses.cpp +++ b/client/battle/BattleAnimationClasses.cpp @@ -355,9 +355,9 @@ bool MovementAnimation::init() myAnim->setType(ECreatureAnimType::MOVING); } - if (moveSoundHander == -1) + if (moveSoundHandler == -1) { - moveSoundHander = CCS->soundh->playSound(stack->unitType()->sounds.move, -1); + moveSoundHandler = CCS->soundh->playSound(stack->unitType()->sounds.move, -1); } Point begPosition = owner.stacksController->getStackPositionAtHex(prevHex, stack); @@ -398,12 +398,12 @@ void MovementAnimation::tick(uint32_t msPassed) myAnim->pos.moveTo(coords); // true if creature haven't reached the final destination hex - if ((curentMoveIndex + 1) < destTiles.size()) + if ((currentMoveIndex + 1) < destTiles.size()) { // update the next hex field which has to be reached by the stack - curentMoveIndex++; + currentMoveIndex++; prevHex = nextHex; - nextHex = destTiles[curentMoveIndex]; + nextHex = destTiles[currentMoveIndex]; // request re-initialization initialized = false; @@ -417,18 +417,18 @@ MovementAnimation::~MovementAnimation() { assert(stack); - if(moveSoundHander != -1) - CCS->soundh->stopSound(moveSoundHander); + if(moveSoundHandler != -1) + CCS->soundh->stopSound(moveSoundHandler); } MovementAnimation::MovementAnimation(BattleInterface & owner, const CStack *stack, std::vector _destTiles, int _distance) : StackMoveAnimation(owner, stack, stack->getPosition(), _destTiles.front()), destTiles(_destTiles), - curentMoveIndex(0), + currentMoveIndex(0), begX(0), begY(0), distanceX(0), distanceY(0), progressPerSecond(0.0), - moveSoundHander(-1), + moveSoundHandler(-1), progress(0.0) { logAnim->debug("Created MovementAnimation for %s", stack->getName()); @@ -649,7 +649,7 @@ void RangedAttackAnimation::setAnimationGroup() Point shooterPos = stackAnimation(attackingStack)->pos.topLeft(); Point shotTarget = owner.stacksController->getStackPositionAtHex(dest, defendingStack); - //maximal angle in radians between straight horizontal line and shooting line for which shot is considered to be straight (absoulte value) + //maximal angle in radians between straight horizontal line and shooting line for which shot is considered to be straight (absolute value) static const double straightAngle = 0.2; double projectileAngle = -atan2(shotTarget.y - shooterPos.y, std::abs(shotTarget.x - shooterPos.x)); @@ -672,18 +672,18 @@ void RangedAttackAnimation::initializeProjectile() if (getGroup() == getUpwardsGroup()) { - shotOrigin.x += ( -25 + shooterInfo->animation.upperRightMissleOffsetX ) * multiplier; - shotOrigin.y += shooterInfo->animation.upperRightMissleOffsetY; + shotOrigin.x += ( -25 + shooterInfo->animation.upperRightMissileOffsetX ) * multiplier; + shotOrigin.y += shooterInfo->animation.upperRightMissileOffsetY; } else if (getGroup() == getDownwardsGroup()) { - shotOrigin.x += ( -25 + shooterInfo->animation.lowerRightMissleOffsetX ) * multiplier; - shotOrigin.y += shooterInfo->animation.lowerRightMissleOffsetY; + shotOrigin.x += ( -25 + shooterInfo->animation.lowerRightMissileOffsetX ) * multiplier; + shotOrigin.y += shooterInfo->animation.lowerRightMissileOffsetY; } else if (getGroup() == getForwardGroup()) { - shotOrigin.x += ( -25 + shooterInfo->animation.rightMissleOffsetX ) * multiplier; - shotOrigin.y += shooterInfo->animation.rightMissleOffsetY; + shotOrigin.x += ( -25 + shooterInfo->animation.rightMissileOffsetX ) * multiplier; + shotOrigin.y += shooterInfo->animation.rightMissileOffsetY; } else { diff --git a/client/battle/BattleAnimationClasses.h b/client/battle/BattleAnimationClasses.h index 00b68bf7a..fb2e6f85b 100644 --- a/client/battle/BattleAnimationClasses.h +++ b/client/battle/BattleAnimationClasses.h @@ -141,10 +141,10 @@ protected: class MovementAnimation : public StackMoveAnimation { private: - int moveSoundHander; // sound handler used when moving a unit + int moveSoundHandler; // sound handler used when moving a unit std::vector destTiles; //full path, includes already passed hexes - ui32 curentMoveIndex; // index of nextHex in destTiles + ui32 currentMoveIndex; // index of nextHex in destTiles double begX, begY; // starting position double distanceX, distanceY; // full movement distance, may be negative if creture moves topleft diff --git a/client/battle/BattleFieldController.cpp b/client/battle/BattleFieldController.cpp index d55c22360..aeb4e2817 100644 --- a/client/battle/BattleFieldController.cpp +++ b/client/battle/BattleFieldController.cpp @@ -84,7 +84,7 @@ namespace HexMasks std::map hexEdgeMaskToFrameIndex; -// Maps HexEdgesMask to "Frame" indexes for range highligt images +// Maps HexEdgesMask to "Frame" indexes for range highlight images void initializeHexEdgeMaskToFrameIndex() { hexEdgeMaskToFrameIndex[HexMasks::empty] = 0; @@ -548,12 +548,12 @@ std::vector> BattleFieldController::calculateRangeLimitH return output; } -void BattleFieldController::calculateRangeLimitAndHighlightImages(uint8_t distance, std::shared_ptr rangeLimitImages, std::vector & rangeLimitHexes, std::vector> & rangeLimitHexesHighligts) +void BattleFieldController::calculateRangeLimitAndHighlightImages(uint8_t distance, std::shared_ptr rangeLimitImages, std::vector & rangeLimitHexes, std::vector> & rangeLimitHexesHighlights) { std::vector rangeHexes = getRangeHexes(hoveredHex, distance); rangeLimitHexes = getRangeLimitHexes(hoveredHex, rangeHexes, distance); std::vector> rangeLimitNeighbourDirections = getOutsideNeighbourDirectionsForLimitHexes(rangeHexes, rangeLimitHexes); - rangeLimitHexesHighligts = calculateRangeLimitHighlightImages(rangeLimitNeighbourDirections, rangeLimitImages); + rangeLimitHexesHighlights = calculateRangeLimitHighlightImages(rangeLimitNeighbourDirections, rangeLimitImages); } void BattleFieldController::flipRangeLimitImagesIntoPositions(std::shared_ptr images) @@ -581,8 +581,8 @@ void BattleFieldController::showHighlightedHexes(Canvas & canvas) std::vector rangedFullDamageLimitHexes; std::vector shootingRangeLimitHexes; - std::vector> rangedFullDamageLimitHexesHighligts; - std::vector> shootingRangeLimitHexesHighligts; + std::vector> rangedFullDamageLimitHexesHighlights; + std::vector> shootingRangeLimitHexesHighlights; std::set hoveredStackMovementRangeHexes = getMovementRangeForHoveredStack(); std::set hoveredSpellHexes = getHighlightedHexesForSpellRange(); @@ -598,11 +598,11 @@ void BattleFieldController::showHighlightedHexes(Canvas & canvas) { // calculate array with highlight images for ranged full damage limit auto rangedFullDamageDistance = hoveredStack->getRangedFullDamageDistance(); - calculateRangeLimitAndHighlightImages(rangedFullDamageDistance, rangedFullDamageLimitImages, rangedFullDamageLimitHexes, rangedFullDamageLimitHexesHighligts); + calculateRangeLimitAndHighlightImages(rangedFullDamageDistance, rangedFullDamageLimitImages, rangedFullDamageLimitHexes, rangedFullDamageLimitHexesHighlights); // calculate array with highlight images for shooting range limit auto shootingRangeDistance = hoveredStack->getShootingRangeDistance(); - calculateRangeLimitAndHighlightImages(shootingRangeDistance, shootingRangeLimitImages, shootingRangeLimitHexes, shootingRangeLimitHexesHighligts); + calculateRangeLimitAndHighlightImages(shootingRangeDistance, shootingRangeLimitImages, shootingRangeLimitHexes, shootingRangeLimitHexesHighlights); } auto const & hoveredMouseHexes = hoveredHex != BattleHex::INVALID && owner.actionsController->currentActionSpellcasting(getHoveredHex()) ? hoveredSpellHexes : hoveredMoveHexes; @@ -635,11 +635,11 @@ void BattleFieldController::showHighlightedHexes(Canvas & canvas) } if(hexInRangedFullDamageLimit) { - showHighlightedHex(canvas, rangedFullDamageLimitHexesHighligts[hexIndexInRangedFullDamageLimit], hex, false); + showHighlightedHex(canvas, rangedFullDamageLimitHexesHighlights[hexIndexInRangedFullDamageLimit], hex, false); } if(hexInShootingRangeLimit) { - showHighlightedHex(canvas, shootingRangeLimitHexesHighligts[hexIndexInShootingRangeLimit], hex, false); + showHighlightedHex(canvas, shootingRangeLimitHexesHighlights[hexIndexInShootingRangeLimit], hex, false); } } } @@ -865,7 +865,7 @@ bool BattleFieldController::isTileAttackable(const BattleHex & number) const void BattleFieldController::updateAccessibleHexes() { - auto accessibility = owner.getBattle()->getAccesibility(); + auto accessibility = owner.getBattle()->getAccessibility(); for(int i = 0; i < accessibility.size(); i++) stackCountOutsideHexes[i] = (accessibility[i] == EAccessibility::ACCESSIBLE || (accessibility[i] == EAccessibility::SIDE_COLUMN)); diff --git a/client/battle/BattleFieldController.h b/client/battle/BattleFieldController.h index 4a713a5de..359c82ad8 100644 --- a/client/battle/BattleFieldController.h +++ b/client/battle/BattleFieldController.h @@ -73,7 +73,7 @@ class BattleFieldController : public CIntObject /// calculate if a hex is in range limit and return its index in range bool IsHexInRangeLimit(BattleHex hex, std::vector & rangeLimitHexes, int * hexIndexInRangeLimit); - /// get an array that has for each hex in range, an aray with all directions where an ouside neighbour hex exists + /// get an array that has for each hex in range, an array with all directions where an outside neighbour hex exists std::vector> getOutsideNeighbourDirectionsForLimitHexes(std::vector rangeHexes, std::vector rangeLimitHexes); /// calculates what image to use as range limit, depending on the direction of neighbors @@ -82,7 +82,7 @@ class BattleFieldController : public CIntObject std::vector> calculateRangeLimitHighlightImages(std::vector> hexesNeighbourDirections, std::shared_ptr limitImages); /// calculates all hexes for a range limit and what images to be shown as highlight for each of the hexes - void calculateRangeLimitAndHighlightImages(uint8_t distance, std::shared_ptr rangeLimitImages, std::vector & rangeLimitHexes, std::vector> & rangeLimitHexesHighligts); + void calculateRangeLimitAndHighlightImages(uint8_t distance, std::shared_ptr rangeLimitImages, std::vector & rangeLimitHexes, std::vector> & rangeLimitHexesHighlights); /// to reduce the number of source images used, some images will be used as flipped versions of preloaded ones void flipRangeLimitImagesIntoPositions(std::shared_ptr images); diff --git a/client/battle/BattleInterface.h b/client/battle/BattleInterface.h index 621cf1e84..49e63ebbb 100644 --- a/client/battle/BattleInterface.h +++ b/client/battle/BattleInterface.h @@ -206,7 +206,7 @@ public: void stacksAreAttacked(std::vector attackedInfos); //called when a certain amount of stacks has been attacked void stackAttacking(const StackAttackInfo & attackInfo); //called when stack with id ID is attacking something on hex dest void newRoundFirst(); - void newRound(); //caled when round is ended; + void newRound(); //called when round is ended; void stackIsCatapulting(const CatapultAttack & ca); //called when a stack is attacking walls void battleFinished(const BattleResult& br, QueryID queryID); //called when battle is finished - battleresult window should be printed void spellCast(const BattleSpellCast *sc); //called when a hero casts a spell diff --git a/client/battle/BattleProjectileController.cpp b/client/battle/BattleProjectileController.cpp index ba6b9778a..1a8117baa 100644 --- a/client/battle/BattleProjectileController.cpp +++ b/client/battle/BattleProjectileController.cpp @@ -161,7 +161,7 @@ const CCreature & BattleProjectileController::getShooter(const CStack * stack) c if(creature->getId() == CreatureID::ARROW_TOWERS) creature = owner.siegeController->getTurretCreature(); - if(creature->animation.missleFrameAngles.empty()) + if(creature->animation.missileFrameAngles.empty()) { logAnim->error("Mod error: Creature '%s' on the Archer's tower is not a shooter. Mod should be fixed. Trying to use archer's data instead...", creature->getNameSingularTranslated()); creature = CreatureID(CreatureID::ARCHER).toCreature(); @@ -277,7 +277,7 @@ int BattleProjectileController::computeProjectileFrameID( Point from, Point dest { const CCreature & creature = getShooter(stack); - auto & angles = creature.animation.missleFrameAngles; + auto & angles = creature.animation.missileFrameAngles; auto animation = getProjectileImage(stack); // only frames below maxFrame are usable: anything higher is either no present or we don't know when it should be used diff --git a/client/battle/BattleSiegeController.cpp b/client/battle/BattleSiegeController.cpp index 6e3acb82b..0d1321b0d 100644 --- a/client/battle/BattleSiegeController.cpp +++ b/client/battle/BattleSiegeController.cpp @@ -126,7 +126,7 @@ ImagePath BattleSiegeController::getBattleBackgroundName() const return ImagePath::builtinTODO(prefix + "BACK.BMP"); } -bool BattleSiegeController::getWallPieceExistance(EWallVisual::EWallVisual what) const +bool BattleSiegeController::getWallPieceExistence(EWallVisual::EWallVisual what) const { //FIXME: use this instead of buildings test? //ui8 siegeLevel = owner.curInt->cb->battleGetSiegeLevel(); @@ -179,7 +179,7 @@ BattleSiegeController::BattleSiegeController(BattleInterface & owner, const CGTo if ( g == EWallVisual::GATE ) // gate is initially closed and has no image to display in this state continue; - if ( !getWallPieceExistance(EWallVisual::EWallVisual(g)) ) + if ( !getWallPieceExistence(EWallVisual::EWallVisual(g)) ) continue; wallPieceImages[g] = GH.renderHandler().loadImage(getWallPieceImageName(EWallVisual::EWallVisual(g), EWallState::REINFORCED)); @@ -256,10 +256,10 @@ void BattleSiegeController::gateStateChanged(const EGateState state) void BattleSiegeController::showAbsoluteObstacles(Canvas & canvas) { - if (getWallPieceExistance(EWallVisual::MOAT)) + if (getWallPieceExistence(EWallVisual::MOAT)) showWallPiece(canvas, EWallVisual::MOAT); - if (getWallPieceExistance(EWallVisual::MOAT_BANK)) + if (getWallPieceExistence(EWallVisual::MOAT_BANK)) showWallPiece(canvas, EWallVisual::MOAT_BANK); } @@ -292,7 +292,7 @@ void BattleSiegeController::collectRenderableObjects(BattleRenderer & renderer) { auto wallPiece = EWallVisual::EWallVisual(i); - if ( !getWallPieceExistance(wallPiece)) + if ( !getWallPieceExistence(wallPiece)) continue; if ( getWallPiecePosition(wallPiece) == BattleHex::INVALID) diff --git a/client/battle/BattleSiegeController.h b/client/battle/BattleSiegeController.h index 196967296..93da58923 100644 --- a/client/battle/BattleSiegeController.h +++ b/client/battle/BattleSiegeController.h @@ -83,7 +83,7 @@ class BattleSiegeController BattleHex getWallPiecePosition(EWallVisual::EWallVisual what) const; /// returns true if chosen wall piece should be present in current battle - bool getWallPieceExistance(EWallVisual::EWallVisual what) const; + bool getWallPieceExistence(EWallVisual::EWallVisual what) const; void showWallPiece(Canvas & canvas, EWallVisual::EWallVisual what); diff --git a/client/battle/BattleStacksController.cpp b/client/battle/BattleStacksController.cpp index e25a9edd9..4e67c9098 100644 --- a/client/battle/BattleStacksController.cpp +++ b/client/battle/BattleStacksController.cpp @@ -438,7 +438,7 @@ void BattleStacksController::stacksAreAttacked(std::vector at // defender need to face in direction opposited to out attacker bool needsReverse = shouldAttackFacingRight(attackedInfo.attacker, attackedInfo.defender) == facingRight(attackedInfo.defender); - // FIXME: this check is better, however not usable since stacksAreAttacked is called after net pack is applyed - petrification is already removed + // FIXME: this check is better, however not usable since stacksAreAttacked is called after net pack is applied - petrification is already removed // if (needsReverse && !attackedInfo.defender->isFrozen()) if (needsReverse && stackAnimation[attackedInfo.defender->unitId()]->getType() != ECreatureAnimType::FROZEN) { diff --git a/client/battle/CreatureAnimation.cpp b/client/battle/CreatureAnimation.cpp index 2addb4c3d..53bca89a4 100644 --- a/client/battle/CreatureAnimation.cpp +++ b/client/battle/CreatureAnimation.cpp @@ -372,7 +372,7 @@ void CreatureAnimation::nextFrame(Canvas & canvas, const ColorFilter & shifter, IImage::SpecialPalette SpecialPalette; genSpecialPalette(SpecialPalette); - image->setSpecialPallete(SpecialPalette, IImage::SPECIAL_PALETTE_MASK_CREATURES); + image->setSpecialPalette(SpecialPalette, IImage::SPECIAL_PALETTE_MASK_CREATURES); image->adjustPalette(shifter, IImage::SPECIAL_PALETTE_MASK_CREATURES); canvas.draw(image, pos.topLeft(), Rect(0, 0, pos.w, pos.h)); diff --git a/client/eventsSDL/InputSourceGameController.cpp b/client/eventsSDL/InputSourceGameController.cpp index 88e305317..94e3ac450 100644 --- a/client/eventsSDL/InputSourceGameController.cpp +++ b/client/eventsSDL/InputSourceGameController.cpp @@ -39,7 +39,7 @@ InputSourceGameController::InputSourceGameController(): scrollAxisValueY(0), scrollPlanDisX(0.0), scrollPlanDisY(0.0), - configTriggerTreshold(settings["input"]["controllerTriggerTreshold"].Float()), + configTriggerThreshold(settings["input"]["controllerTriggerThreshold"].Float()), configAxisDeadZone(settings["input"]["controllerAxisDeadZone"].Float()), configAxisFullZone(settings["input"]["controllerAxisFullZone"].Float()), configAxisSpeed(settings["input"]["controllerAxisSpeed"].Float()), @@ -142,7 +142,7 @@ double InputSourceGameController::getRealAxisValue(int value) const void InputSourceGameController::dispatchAxisShortcuts(const std::vector & shortcutsVector, SDL_GameControllerAxis axisID, int axisValue) { - if(getRealAxisValue(axisValue) > configTriggerTreshold) + if(getRealAxisValue(axisValue) > configTriggerThreshold) { if(!pressedAxes.count(axisID)) { diff --git a/client/eventsSDL/InputSourceGameController.h b/client/eventsSDL/InputSourceGameController.h index 8a69053fe..e61a92fe9 100644 --- a/client/eventsSDL/InputSourceGameController.h +++ b/client/eventsSDL/InputSourceGameController.h @@ -39,7 +39,7 @@ class InputSourceGameController double scrollPlanDisX; double scrollPlanDisY; - const double configTriggerTreshold; + const double configTriggerThreshold; const double configAxisDeadZone; const double configAxisFullZone; const double configAxisSpeed; diff --git a/client/globalLobby/GlobalLobbyLoginWindow.cpp b/client/globalLobby/GlobalLobbyLoginWindow.cpp index 1c8f98e85..48748548e 100644 --- a/client/globalLobby/GlobalLobbyLoginWindow.cpp +++ b/client/globalLobby/GlobalLobbyLoginWindow.cpp @@ -65,7 +65,7 @@ GlobalLobbyLoginWindow::GlobalLobbyLoginWindow() { buttonLogin->block(true); toggleMode->setSelected(0); - onLoginModeChanged(0); // call it manually to disable widgets - toggleMode will not emit this call if this is currenly selected option + onLoginModeChanged(0); // call it manually to disable widgets - toggleMode will not emit this call if this is currently selected option } else toggleMode->setSelected(1); diff --git a/client/gui/CIntObject.h b/client/gui/CIntObject.h index bde3c1f81..06b484376 100644 --- a/client/gui/CIntObject.h +++ b/client/gui/CIntObject.h @@ -79,7 +79,7 @@ public: /// deactivates if needed, blocks all automatic activity, allows only disposal void disable(); - /// activates if needed, all activity enabled (Warning: may not be symetric with disable if recActions was limited!) + /// activates if needed, all activity enabled (Warning: may not be symmetric with disable if recActions was limited!) void enable(); /// deactivates or activates UI element based on flag void setEnabled(bool on); diff --git a/client/gui/EventDispatcher.cpp b/client/gui/EventDispatcher.cpp index df4a7edd4..75d874098 100644 --- a/client/gui/EventDispatcher.cpp +++ b/client/gui/EventDispatcher.cpp @@ -304,7 +304,7 @@ void EventDispatcher::dispatchTextInput(const std::string & text) { for(auto it : textInterested) { - it->textInputed(text); + it->textInputted(text); } } diff --git a/client/gui/EventsReceiver.h b/client/gui/EventsReceiver.h index 2d5fedede..d6eaf5a37 100644 --- a/client/gui/EventsReceiver.h +++ b/client/gui/EventsReceiver.h @@ -67,7 +67,7 @@ public: /// Called when UI element gesture status changes virtual void gesture(bool on, const Point & initialPosition, const Point & finalPosition) {} - virtual void textInputed(const std::string & enteredText) {} + virtual void textInputted(const std::string & enteredText) {} virtual void textEdited(const std::string & enteredText) {} virtual void keyPressed(EShortcut key) {} diff --git a/client/gui/FramerateManager.h b/client/gui/FramerateManager.h index d653bd667..24080280f 100644 --- a/client/gui/FramerateManager.h +++ b/client/gui/FramerateManager.h @@ -22,7 +22,7 @@ class FramerateManager Duration targetFrameTime; TimePoint lastTimePoint; - /// index of last measured frome in lastFrameTimes array + /// index of last measured from in lastFrameTimes array ui32 lastFrameIndex; bool vsyncEnabled; diff --git a/client/gui/InterfaceObjectConfigurable.h b/client/gui/InterfaceObjectConfigurable.h index c4fd3aad0..56b397ce9 100644 --- a/client/gui/InterfaceObjectConfigurable.h +++ b/client/gui/InterfaceObjectConfigurable.h @@ -41,7 +41,7 @@ public: InterfaceObjectConfigurable(const JsonNode & config, int used=0, Point offset=Point()); protected: - /// Set blocked status for all buttons assotiated with provided shortcut + /// Set blocked status for all buttons associated with provided shortcut void setShortcutBlocked(EShortcut shortcut, bool isBlocked); /// Registers provided callback to be called whenever specified shortcut is triggered diff --git a/client/lobby/RandomMapTab.cpp b/client/lobby/RandomMapTab.cpp index 68c5ab846..277f1ecfe 100644 --- a/client/lobby/RandomMapTab.cpp +++ b/client/lobby/RandomMapTab.cpp @@ -559,7 +559,7 @@ TeamAlignmentsWidget::TeamAlignmentsWidget(RandomMapTab & randomMapTab): players.back()->addToggle(teamId, std::dynamic_pointer_cast(button)); } - // plId is not neccessarily player color, just an index + // plId is not necessarily player color, just an index auto team = settingsVec.at(plId).getTeam(); if(team == TeamID::NO_TEAM) { @@ -577,9 +577,9 @@ TeamAlignmentsWidget::TeamAlignmentsWidget(RandomMapTab & randomMapTab): void RandomMapTab::saveOptions(const CMapGenOptions & options) { JsonNode data; - JsonSerializer ser(nullptr, data); + JsonSerializer set(nullptr, data); - ser.serializeStruct("lastSettings", const_cast(options)); + set.serializeStruct("lastSettings", const_cast(options)); // FIXME: Do not nest fields Settings rmgSettings = persistentStorage.write["rmg"]; diff --git a/client/mainmenu/CMainMenu.cpp b/client/mainmenu/CMainMenu.cpp index 3e8c5f1ca..b464f5dc4 100644 --- a/client/mainmenu/CMainMenu.cpp +++ b/client/mainmenu/CMainMenu.cpp @@ -136,7 +136,7 @@ size_t CMenuScreen::getActiveTab() const return tabs->getActive(); } -//funciton for std::string -> std::function conversion for main menu +//function for std::string -> std::function conversion for main menu static std::function genCommand(CMenuScreen * menu, std::vector menuType, const std::string & string) { static const std::vector commandType = {"to", "campaigns", "start", "load", "exit", "highscores"}; diff --git a/client/mapView/MapView.cpp b/client/mapView/MapView.cpp index 8d6405fd5..30c652ad2 100644 --- a/client/mapView/MapView.cpp +++ b/client/mapView/MapView.cpp @@ -187,7 +187,7 @@ void MapView::postSwipe(uint32_t msPassed) std::pair firstAccepted; uint32_t now = GH.input().getTicks(); for (auto & x : swipeHistory) { - if(now - x.first < postSwipeCatchIntervalMs) { // only the last x ms are catched + if(now - x.first < postSwipeCatchIntervalMs) { // only the last x ms are caught if(firstAccepted.first == 0) firstAccepted = x; diff += x.second; diff --git a/client/media/CMusicHandler.cpp b/client/media/CMusicHandler.cpp index b608bbab9..0721b9354 100644 --- a/client/media/CMusicHandler.cpp +++ b/client/media/CMusicHandler.cpp @@ -289,7 +289,7 @@ bool MusicEntry::play() // erase stored position: // if music track will be interrupted again - new position will be written in stop() method - // if music track is not interrupted and will finish by timeout/end of file - it will restart from begginning as it should + // if music track is not interrupted and will finish by timeout/end of file - it will restart from beginning as it should owner->trackPositions.erase(owner->trackPositions.find(currentName)); if(Mix_FadeInMusicPos(music, 1, 1000, timeToStart) == -1) diff --git a/client/media/CSoundHandler.cpp b/client/media/CSoundHandler.cpp index 532cdc617..bd27477fa 100644 --- a/client/media/CSoundHandler.cpp +++ b/client/media/CSoundHandler.cpp @@ -147,7 +147,7 @@ uint32_t CSoundHandler::getSoundDurationMilliseconds(const AudioPath & sound) SDL_AudioSpec spec; uint32_t audioLen; uint8_t * audioBuf; - uint32_t miliseconds = 0; + uint32_t milliseconds = 0; if(SDL_LoadWAV_RW(SDL_RWFromMem(data.first.get(), data.second), 1, &spec, &audioBuf, &audioLen) != nullptr) { @@ -155,10 +155,10 @@ uint32_t CSoundHandler::getSoundDurationMilliseconds(const AudioPath & sound) uint32_t sampleSize = SDL_AUDIO_BITSIZE(spec.format) / 8; uint32_t sampleCount = audioLen / sampleSize; uint32_t sampleLen = sampleCount / spec.channels; - miliseconds = 1000 * sampleLen / spec.freq; + milliseconds = 1000 * sampleLen / spec.freq; } - return miliseconds; + return milliseconds; } // Plays a sound, and return its channel so we can fade it out later @@ -292,7 +292,7 @@ void CSoundHandler::soundFinishedCallback(int channel) return; // store callbacks from container locally - SDL might reuse this channel for another sound - // but do actualy execution in separate thread, to avoid potential deadlocks in case if callback requires locks of its own + // but do actually execution in separate thread, to avoid potential deadlocks in case if callback requires locks of its own auto callback = callbacks.at(channel); callbacks.erase(channel); diff --git a/client/render/Canvas.h b/client/render/Canvas.h index 647c1ddde..7821a59fe 100644 --- a/client/render/Canvas.h +++ b/client/render/Canvas.h @@ -29,14 +29,14 @@ class Canvas /// constructs canvas using existing surface. Caller maintains ownership on the surface explicit Canvas(SDL_Surface * surface); - /// copy contructor + /// copy constructor Canvas(const Canvas & other); public: Canvas & operator = (const Canvas & other) = delete; Canvas & operator = (Canvas && other) = delete; - /// move contructor + /// move constructor Canvas(Canvas && other); /// creates canvas that only covers specified subsection of a surface diff --git a/client/render/IImage.h b/client/render/IImage.h index adf5126cd..2b8bf1d8d 100644 --- a/client/render/IImage.h +++ b/client/render/IImage.h @@ -76,7 +76,7 @@ public: virtual void setBlitMode(EImageBlitMode mode) = 0; //only indexed bitmaps with 7 special colors - virtual void setSpecialPallete(const SpecialPalette & SpecialPalette, uint32_t colorsToSkipMask) = 0; + virtual void setSpecialPalette(const SpecialPalette & SpecialPalette, uint32_t colorsToSkipMask) = 0; virtual void horizontalFlip() = 0; virtual void verticalFlip() = 0; diff --git a/client/renderSDL/SDLImage.cpp b/client/renderSDL/SDLImage.cpp index 6dbe8db94..2a1291c67 100644 --- a/client/renderSDL/SDLImage.cpp +++ b/client/renderSDL/SDLImage.cpp @@ -321,7 +321,7 @@ void SDLImage::resetPalette() if(originalPalette == nullptr) return; - // Always keept the original palette not changed, copy a new palette to assign to surface + // Always keep the original palette not changed, copy a new palette to assign to surface SDL_SetPaletteColors(surf->format->palette, originalPalette->colors, 0, originalPalette->ncolors); } @@ -330,11 +330,11 @@ void SDLImage::resetPalette( int colorID ) if(originalPalette == nullptr) return; - // Always keept the original palette not changed, copy a new palette to assign to surface + // Always keep the original palette not changed, copy a new palette to assign to surface SDL_SetPaletteColors(surf->format->palette, originalPalette->colors + colorID, colorID, 1); } -void SDLImage::setSpecialPallete(const IImage::SpecialPalette & specialPalette, uint32_t colorsToSkipMask) +void SDLImage::setSpecialPalette(const IImage::SpecialPalette & specialPalette, uint32_t colorsToSkipMask) { if(surf->format->palette) { diff --git a/client/renderSDL/SDLImage.h b/client/renderSDL/SDLImage.h index 05c516fa2..59487ff35 100644 --- a/client/renderSDL/SDLImage.h +++ b/client/renderSDL/SDLImage.h @@ -74,7 +74,7 @@ public: void setAlpha(uint8_t value) override; void setBlitMode(EImageBlitMode mode) override; - void setSpecialPallete(const SpecialPalette & SpecialPalette, uint32_t colorsToSkipMask) override; + void setSpecialPalette(const SpecialPalette & SpecialPalette, uint32_t colorsToSkipMask) override; friend class SDLImageLoader; diff --git a/client/widgets/Buttons.h b/client/widgets/Buttons.h index a3797d49b..e5bad6aab 100644 --- a/client/widgets/Buttons.h +++ b/client/widgets/Buttons.h @@ -154,7 +154,7 @@ public: void addCallback(const std::function & callback); - /// Set whether the toggle is currently enabled for user to use, this is only inplemented in ToggleButton, not for other toggles yet. + /// Set whether the toggle is currently enabled for user to use, this is only implemented in ToggleButton, not for other toggles yet. virtual void setEnabled(bool enabled); }; diff --git a/client/widgets/CTextInput.cpp b/client/widgets/CTextInput.cpp index 5aefa2598..46d824665 100644 --- a/client/widgets/CTextInput.cpp +++ b/client/widgets/CTextInput.cpp @@ -189,7 +189,7 @@ void CTextInput::updateLabel() label->setText(visibleText); } -void CTextInput::textInputed(const std::string & enteredText) +void CTextInput::textInputted(const std::string & enteredText) { if(!hasFocus()) return; diff --git a/client/widgets/CTextInput.h b/client/widgets/CTextInput.h index a4cd7e22a..ea64d6ded 100644 --- a/client/widgets/CTextInput.h +++ b/client/widgets/CTextInput.h @@ -70,7 +70,7 @@ class CTextInput final : public CFocusable void updateLabel(); void clickPressed(const Point & cursorPosition) final; - void textInputed(const std::string & enteredText) final; + void textInputted(const std::string & enteredText) final; void textEdited(const std::string & enteredText) final; void onFocusGot() final; void onFocusLost() final; diff --git a/client/widgets/Images.h b/client/widgets/Images.h index 94fef0c1c..004f7916a 100644 --- a/client/widgets/Images.h +++ b/client/widgets/Images.h @@ -31,7 +31,7 @@ public: /// if set, only specified section of internal image will be rendered std::optional srcRect; - /// If set to true, iamge will be redrawn on each frame + /// If set to true, image will be redrawn on each frame bool needRefresh; std::shared_ptr getSurface() diff --git a/client/widgets/ObjectLists.h b/client/widgets/ObjectLists.h index 07b81c1be..d4e07de08 100644 --- a/client/widgets/ObjectLists.h +++ b/client/widgets/ObjectLists.h @@ -77,7 +77,7 @@ public: //ItemOffset - distance between items in the list //VisibleSize - maximal number of displayable at once items //TotalSize - //Slider - slider style, bit field: 1 = present(disabled), 2=horisontal(vertical), 4=blue(brown) + //Slider - slider style, bit field: 1 = present(disabled), 2=horizontal(vertical), 4=blue(brown) //SliderPos - position of slider, if present CListBox(CreateFunc create, Point Pos, Point ItemOffset, size_t VisibleSize, size_t TotalSize, size_t InitialPos=0, int Slider=0, Rect SliderPos=Rect() ); diff --git a/client/widgets/TextControls.cpp b/client/widgets/TextControls.cpp index 5c9fdf7d5..c7864db13 100644 --- a/client/widgets/TextControls.cpp +++ b/client/widgets/TextControls.cpp @@ -173,13 +173,13 @@ void CTextContainer::blitLine(Canvas & to, Rect destRect, std::string what) { const auto f = graphics->fonts[font]; Point where = destRect.topLeft(); - const std::string delimeters = "{}"; - auto delimitersCount = std::count_if(what.cbegin(), what.cend(), [&delimeters](char c) + const std::string delimiters = "{}"; + auto delimitersCount = std::count_if(what.cbegin(), what.cend(), [&delimiters](char c) { - return delimeters.find(c) != std::string::npos; + return delimiters.find(c) != std::string::npos; }); //We should count delimiters length from string to correct centering later. - delimitersCount *= f->getStringWidth(delimeters)/2; + delimitersCount *= f->getStringWidth(delimiters)/2; std::smatch match; std::regex expr("\\{(.*?)\\|"); @@ -214,16 +214,16 @@ void CTextContainer::blitLine(Canvas & to, Rect destRect, std::string what) where.y += getBorderSize().y + destRect.h - static_cast(f->getLineHeight()); size_t begin = 0; - size_t currDelimeter = 0; + size_t currDelimiter = 0; do { - size_t end = what.find_first_of(delimeters[currDelimeter % 2], begin); + size_t end = what.find_first_of(delimiters[currDelimiter % 2], begin); if(begin != end) { std::string toPrint = what.substr(begin, end - begin); - if(currDelimeter % 2) // Enclosed in {} text - set to yellow or defined color + if(currDelimiter % 2) // Enclosed in {} text - set to yellow or defined color { std::smatch match; std::regex expr("^(.*?)\\|"); @@ -249,7 +249,7 @@ void CTextContainer::blitLine(Canvas & to, Rect destRect, std::string what) where.x += (int)f->getStringWidth(toPrint); } - currDelimeter++; + currDelimiter++; } while(begin++ != std::string::npos); } diff --git a/client/windows/CCastleInterface.cpp b/client/windows/CCastleInterface.cpp index cb9963f0b..14467fb46 100644 --- a/client/windows/CCastleInterface.cpp +++ b/client/windows/CCastleInterface.cpp @@ -234,7 +234,7 @@ std::string CBuildingRect::getSubtitle()//hover text for building int bid = getBuilding()->bid; - if (bid<30)//non-dwellings - only buiding name + if (bid<30)//non-dwellings - only building name return town->town->buildings.at(getBuilding()->bid)->getNameTranslated(); else//dwellings - recruit %creature% { @@ -476,7 +476,7 @@ void CHeroGSlot::setHighlight(bool on) if(owner->garrisonedHero->hero && owner->visitingHero->hero) //two heroes in town { - for(auto & elem : owner->garr->splitButtons) //splitting enabled when slot higlighted + for(auto & elem : owner->garr->splitButtons) //splitting enabled when slot highlighted elem->block(!on); } } @@ -1364,7 +1364,7 @@ void CCastleInterface::removeBuilding(BuildingID bid) void CCastleInterface::recreateIcons() { OBJECT_CONSTRUCTION_CUSTOM_CAPTURING(255-DISPOSE); - size_t iconIndex = town->town->clientInfo.icons[town->hasFort()][town->builded >= CGI->settings()->getInteger(EGameSettings::TOWNS_BUILDINGS_PER_TURN_CAP)]; + size_t iconIndex = town->town->clientInfo.icons[town->hasFort()][town->built >= CGI->settings()->getInteger(EGameSettings::TOWNS_BUILDINGS_PER_TURN_CAP)]; icon->setFrame(iconIndex); TResources townIncome = town->dailyIncome(); diff --git a/client/windows/CCreatureWindow.cpp b/client/windows/CCreatureWindow.cpp index 2394dc400..3dafa0e81 100644 --- a/client/windows/CCreatureWindow.cpp +++ b/client/windows/CCreatureWindow.cpp @@ -59,7 +59,7 @@ public: std::function callback; }; - // pointers to permament objects in game state + // pointers to permanent objects in game state const CCreature * creature; const CCommanderInstance * commander; const CStackInstance * stackNode; @@ -144,10 +144,10 @@ void CCommanderSkillIcon::show(Canvas &to) static ImagePath skillToFile(int skill, int level, bool selected) { - // FIXME: is this a correct hadling? + // FIXME: is this a correct handling? // level 0 = skill not present, use image with "no" suffix // level 1-5 = skill available, mapped to images indexed as 0-4 - // selecting skill means that it will appear one level higher (as if alredy upgraded) + // selecting skill means that it will appear one level higher (as if already upgraded) std::string file = "zvs/Lib1.res/_"; switch (skill) { @@ -170,17 +170,17 @@ static ImagePath skillToFile(int skill, int level, bool selected) file += "MP"; break; } - std::string sufix; + std::string suffix; if (selected) level++; // UI will display resulting level if (level == 0) - sufix = "no"; //not avaliable - no number + suffix = "no"; //not available - no number else - sufix = std::to_string(level-1); + suffix = std::to_string(level-1); if (selected) - sufix += "="; //level-up highlight + suffix += "="; //level-up highlight - return ImagePath::builtin(file + sufix + ".bmp"); + return ImagePath::builtin(file + suffix + ".bmp"); } CStackWindow::CWindowSection::CWindowSection(CStackWindow * parent, const ImagePath & backgroundPath, int yOffset) @@ -343,7 +343,7 @@ CStackWindow::ButtonsSection::ButtonsSection(CStackWindow * owner, int yOffset) upgradeBtn->setOverlay(std::make_shared(AnimationPath::builtin("CPRSMALL"), VLC->creh->objects[upgradeInfo.info.newID[buttonIndex]]->getIconIndex())); - if(buttonsToCreate == 1) // single upgrade avaialbe + if(buttonsToCreate == 1) // single upgrade available upgradeBtn->assignedKey = EShortcut::RECRUITMENT_UPGRADE; upgrade[buttonIndex] = upgradeBtn; diff --git a/client/windows/CCreatureWindow.h b/client/windows/CCreatureWindow.h index d4360462f..4728b3b1f 100644 --- a/client/windows/CCreatureWindow.h +++ b/client/windows/CCreatureWindow.h @@ -35,7 +35,7 @@ class CCommanderSkillIcon : public LRClickableAreaWText //TODO: maybe bring comm { std::shared_ptr object; // passive object that will be used to determine clickable area bool isMasterAbility; // refers to WoG abilities obtainable via combining master skills (for example attack + speed unlocks shoot) - bool isSelected; // used only for programatically created border around selected "master abilities" + bool isSelected; // used only for programmatically created border around selected "master abilities" public: CCommanderSkillIcon(std::shared_ptr object_, bool isMasterAbility_, std::function callback); diff --git a/client/windows/CHeroWindow.h b/client/windows/CHeroWindow.h index 4de73bce7..75a3cff5a 100644 --- a/client/windows/CHeroWindow.h +++ b/client/windows/CHeroWindow.h @@ -102,7 +102,7 @@ public: void update() override; - void dismissCurrent(); //dissmissed currently displayed hero (curHero) + void dismissCurrent(); //dismissed currently displayed hero (curHero) void commanderWindow(); void switchHero(); //changes displayed hero void updateGarrisons() override; diff --git a/client/windows/CKingdomInterface.cpp b/client/windows/CKingdomInterface.cpp index 9cf64bac5..7b57bd51e 100644 --- a/client/windows/CKingdomInterface.cpp +++ b/client/windows/CKingdomInterface.cpp @@ -801,7 +801,7 @@ CTownItem::CTownItem(const CGTownInstance * Town) garr = std::make_shared(Point(313, 3), 4, Point(232,0), town->getUpperArmy(), town->visitingHero, true, true, CGarrisonInt::ESlotsLayout::TWO_ROWS); heroes = std::make_shared(town, Point(244,6), Point(475,6), garr, false); - size_t iconIndex = town->town->clientInfo.icons[town->hasFort()][town->builded >= CGI->settings()->getInteger(EGameSettings::TOWNS_BUILDINGS_PER_TURN_CAP)]; + size_t iconIndex = town->town->clientInfo.icons[town->hasFort()][town->built >= CGI->settings()->getInteger(EGameSettings::TOWNS_BUILDINGS_PER_TURN_CAP)]; picture = std::make_shared(AnimationPath::builtin("ITPT"), iconIndex, 0, 5, 6); openTown = std::make_shared(Rect(5, 6, 58, 64), town); diff --git a/client/windows/CMapOverview.cpp b/client/windows/CMapOverview.cpp index b60973945..adb3ccafc 100644 --- a/client/windows/CMapOverview.cpp +++ b/client/windows/CMapOverview.cpp @@ -136,9 +136,9 @@ std::shared_ptr CMapOverviewWidget::buildDrawMinimap(const JsonNode & return nullptr; Rect minimapRect = minimaps[id].getRenderArea(); - double maxSideLenghtSrc = std::max(minimapRect.w, minimapRect.h); - double maxSideLenghtDst = std::max(rect.w, rect.h); - double resize = maxSideLenghtSrc / maxSideLenghtDst; + double maxSideLengthSrc = std::max(minimapRect.w, minimapRect.h); + double maxSideLengthDst = std::max(rect.w, rect.h); + double resize = maxSideLengthSrc / maxSideLengthDst; Point newMinimapSize = Point(minimapRect.w / resize, minimapRect.h / resize); Canvas canvasScaled = Canvas(Point(rect.w, rect.h)); diff --git a/client/windows/CMessage.cpp b/client/windows/CMessage.cpp index fa575c7e6..68351ba08 100644 --- a/client/windows/CMessage.cpp +++ b/client/windows/CMessage.cpp @@ -176,9 +176,9 @@ std::vector CMessage::breakText(std::string text, size_t maxLineWid std::string CMessage::guessHeader(const std::string & msg) { size_t begin = 0; - std::string delimeters = "{}"; - size_t start = msg.find_first_of(delimeters[0], begin); - size_t end = msg.find_first_of(delimeters[1], start); + std::string delimiters = "{}"; + size_t start = msg.find_first_of(delimiters[0], begin); + size_t end = msg.find_first_of(delimiters[1], start); if(start > msg.size() || end > msg.size()) return ""; return msg.substr(begin, end); diff --git a/client/windows/CQuestLog.cpp b/client/windows/CQuestLog.cpp index bb7b37c04..d0daf0a2b 100644 --- a/client/windows/CQuestLog.cpp +++ b/client/windows/CQuestLog.cpp @@ -129,7 +129,7 @@ CQuestLog::CQuestLog (const std::vector & Quests) // TextBox have it's own 4 pixel padding from top at least for English. To achieve 10px from both left and top only add 6px margin description = std::make_shared("", Rect(205, 18, 385, DESCRIPTION_HEIGHT_MAX), CSlider::BROWN, FONT_MEDIUM, ETextAlignment::TOPLEFT, Colors::WHITE); ok = std::make_shared(Point(539, 398), AnimationPath::builtin("IOKAY.DEF"), CGI->generaltexth->zelp[445], std::bind(&CQuestLog::close, this), EShortcut::GLOBAL_RETURN); - // Both button and lable are shifted to -2px by x and y to not make them actually look like they're on same line with quests list and ok button + // Both button and label are shifted to -2px by x and y to not make them actually look like they're on same line with quests list and ok button hideCompleteButton = std::make_shared(Point(10, 396), AnimationPath::builtin("sysopchk.def"), CButton::tooltipLocalized("vcmi.questLog.hideComplete"), std::bind(&CQuestLog::toggleComplete, this, _1)); hideCompleteLabel = std::make_shared(46, 398, FONT_MEDIUM, ETextAlignment::TOPLEFT, Colors::WHITE, CGI->generaltexth->translate("vcmi.questLog.hideComplete.hover")); slider = std::make_shared(Point(166, 195), 191, std::bind(&CQuestLog::sliderMoved, this, _1), QUEST_COUNT, 0, 0, Orientation::VERTICAL, CSlider::BROWN); diff --git a/client/windows/CWindowObject.h b/client/windows/CWindowObject.h index feecc1243..807c20272 100644 --- a/client/windows/CWindowObject.h +++ b/client/windows/CWindowObject.h @@ -42,7 +42,7 @@ public: }; /* - * options - EOpions enum + * options - EOptions enum * imageName - name for background image, can be empty * centerAt - position of window center. Default - center of the screen */ diff --git a/client/windows/CreaturePurchaseCard.h b/client/windows/CreaturePurchaseCard.h index e5a3388c2..176b95576 100644 --- a/client/windows/CreaturePurchaseCard.h +++ b/client/windows/CreaturePurchaseCard.h @@ -44,7 +44,7 @@ private: void initCostBox(); // This just wraps a clickeable area. There's a weird layout scheme in the file and - // it's easier to just add a separate invisble box on top + // it's easier to just add a separate invisible box on top class CCreatureClickArea : public CIntObject { public: diff --git a/client/windows/GUIClasses.cpp b/client/windows/GUIClasses.cpp index 417090edc..4bd750f31 100644 --- a/client/windows/GUIClasses.cpp +++ b/client/windows/GUIClasses.cpp @@ -153,7 +153,7 @@ void CRecruitmentWindow::buy() std::pair toMerge; bool allowMerge = CGI->settings()->getBoolean(EGameSettings::DWELLINGS_ACCUMULATE_WHEN_OWNED); - if (allowMerge && dst->mergableStacks(toMerge)) + if (allowMerge && dst->mergeableStacks(toMerge)) { LOCPLINT->cb->mergeStacks( dst, dst, toMerge.first, toMerge.second); } diff --git a/cmake_modules/FindSDL2.cmake b/cmake_modules/FindSDL2.cmake index 4228a3c0b..5021681dc 100644 --- a/cmake_modules/FindSDL2.cmake +++ b/cmake_modules/FindSDL2.cmake @@ -82,11 +82,11 @@ This module responds to the following cache variables: SDL2_LIBRARY SDL2 Library (.dll, .so, .a, etc) path. - SDL2MAIN_LIBRAY + SDL2MAIN_LIBRARY SDL2main Library (.a) path. SDL2_BUILDING_LIBRARY - This flag is useful only when linking to SDL2_LIBRARIES insead of + This flag is useful only when linking to SDL2_LIBRARIES instead of SDL2::SDL2main. It is required only when building a library that links to SDL2_LIBRARIES, because only applications need main() (No need to also link to SDL2main). diff --git a/docs/developers/AI.md b/docs/developers/AI.md index 93117004e..d96b454d6 100644 --- a/docs/developers/AI.md +++ b/docs/developers/AI.md @@ -10,7 +10,7 @@ We have 3 battle AIs so far: Each battle AI consist of a few classes, but the main class, kind of entry point usually has the same name as the package itself. In BattleAI it is the BattleAI class. It implements some battle specific interface, do not remember. Main method there is activeStack(battle::Unit* stack). It is invoked by the system when it's time to move your stack. The thing you use to interact with the game and receive the gamestate is usually referenced in the code as cb. CPlayerSpecificCallback it should be. It has a lot of methods and can do anything. For instance it has battleGetUnitsIf(), which returns all units on the battlefield matching some lambda condition. Each side in a battle is represented by an CArmedInstance object. CHeroInstance and CGDwelling, CGMonster and more are subclasses of CArmedInstance. CArmedInstance contains a set of stacks. When the battle starts, these stacks are converted to battle stacks. Usually Battle AIs reference them using the interface battle::Unit *. -Units have bonuses. Nearly everything aspect of a unit is configured in the form of bonuses. Attack, defense, health, retalitation, shooter or not, initial count of shots and so on. +Units have bonuses. Nearly everything aspect of a unit is configured in the form of bonuses. Attack, defense, health, retaliation, shooter or not, initial count of shots and so on. When you call unit->getAttack() it summarizes all these bonuses and returns the resulting value. One important class is HypotheticBattle. It is used to evaluate the effects of an action without changing the actual gamestate. It is a wrapper around CPlayerSpecificCallback or another HypotheticBattle so it can provide you data, Internally it has a set of modified unit states and intercepts some calls to underlying callback and returns these internal states instead. These states in turn are wrappers around original units and contain modified bonuses (CStackWithBonuses). So if you need to emulate an attack you can call hypotheticbattle.getforupdate() and it will return the CStackWithBonuses which you can safely change. diff --git a/docs/developers/Building_iOS.md b/docs/developers/Building_iOS.md index 6a0f97b8c..8383f59ae 100644 --- a/docs/developers/Building_iOS.md +++ b/docs/developers/Building_iOS.md @@ -45,7 +45,7 @@ If you want to speed up the recompilation, add `-D ENABLE_CCACHE=ON` ### Building for device -To be able to build for iOS device, you must also specify codesigning settings. If you don't know your development team ID, open the generated Xcode project, open project settings (click **VCMI** with blue icon on the very top in the left panel with files), select **vcmiclient** target, open **Signing & Capabilities** tab and select yout team. Now you can copy the value from **Build Settings** tab - `DEVELOPMENT_TEAM` variable (paste it in the Filter field on the right) - click the greenish value - Other... - copy. Now you can pass it in `CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM` variable when configuring the project to avoid selecting the team manually every time CMake re-generates the project. +To be able to build for iOS device, you must also specify codesigning settings. If you don't know your development team ID, open the generated Xcode project, open project settings (click **VCMI** with blue icon on the very top in the left panel with files), select **vcmiclient** target, open **Signing & Capabilities** tab and select your team. Now you can copy the value from **Build Settings** tab - `DEVELOPMENT_TEAM` variable (paste it in the Filter field on the right) - click the greenish value - Other... - copy. Now you can pass it in `CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM` variable when configuring the project to avoid selecting the team manually every time CMake re-generates the project. Advanced users who know exact private key and provisioning profile to sign with, can use `CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY` and `CMAKE_XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER` variables instead. In this case you must also pass `-D CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE=Manual`. diff --git a/docs/developers/Code_Structure.md b/docs/developers/Code_Structure.md index 72f11ba0e..cae75b71d 100644 --- a/docs/developers/Code_Structure.md +++ b/docs/developers/Code_Structure.md @@ -33,7 +33,7 @@ Client is responsible for: ## Rendering of graphics -Rendering of graphics relies heavily on SDL. Currently we do not have any wrapper for SDL internal structures and most of rendering is about blitting surfaces using SDL_BlitSurface. We have a few function that make rendering easier or make specific parts of rendering (like printing text). They are places in client/SDL_Extensions and client/SDL_Framerate (the second one contains code responsible for keeping appropriate framerate, it should work more smart than just SDL_Delay(miliseconds)). +Rendering of graphics relies heavily on SDL. Currently we do not have any wrapper for SDL internal structures and most of rendering is about blitting surfaces using SDL_BlitSurface. We have a few function that make rendering easier or make specific parts of rendering (like printing text). They are places in client/SDL_Extensions and client/SDL_Framerate (the second one contains code responsible for keeping appropriate framerate, it should work more smart than just SDL_Delay(milliseconds)). In rendering, Interface object system is quite helpful. Its base is CIntObject class that is basically a base class for our library of GUI components and other objects. # Server @@ -111,7 +111,7 @@ VCAI module is currently developed agent-based system driven by goals and heroes ## Fuzzy logic -VCMI includes [FuzzyLite](http://code.google.com/p/fuzzy-lite/) library to make use of fuzzy rule-based algorithms. They are useful to handle uncertanity and resemble human behaviour who takes decisions based on rough observations. FuzzyLite is linked as separate static library in AI/FuzzyLite.lib file. +VCMI includes [FuzzyLite](http://code.google.com/p/fuzzy-lite/) library to make use of fuzzy rule-based algorithms. They are useful to handle uncertainty and resemble human behaviour who takes decisions based on rough observations. FuzzyLite is linked as separate static library in AI/FuzzyLite.lib file. # Utilities diff --git a/docs/developers/Coding_Guidelines.md b/docs/developers/Coding_Guidelines.md index a7537acbe..4f10d9864 100644 --- a/docs/developers/Coding_Guidelines.md +++ b/docs/developers/Coding_Guidelines.md @@ -759,7 +759,7 @@ The line length for c++ source code is 120 columns. If your function declaration ### Warnings -Avoid use of #pragma to disable warnings. Compile at warning level 3. Avoid commiting code with new warnings. +Avoid use of #pragma to disable warnings. Compile at warning level 3. Avoid committing code with new warnings. ### File/directory naming @@ -789,9 +789,9 @@ The name of the type should be logged first, e.g. {TYPE_NAME: members...}. The m Avoid code duplication or don't repeat yourself(DRY) is the most important aspect in programming. Code duplication of any kind can lead to inconsistency and is much harder to maintain. If one part of the system gets changed you have to change the code in several places. This process is error-prone and leads often to problems. Here you can read more about the DRY principle: [](http://en.wikipedia.org/wiki/Don%27t_repeat_yourself) -### Do not use uncommon abbrevations +### Do not use uncommon abbreviations -Do not use uncommon abbrevations for class, method, parameter and global object names. +Do not use uncommon abbreviations for class, method, parameter and global object names. Bad: diff --git a/docs/developers/Logging_API.md b/docs/developers/Logging_API.md index e2ead1fb6..6b53234b4 100644 --- a/docs/developers/Logging_API.md +++ b/docs/developers/Logging_API.md @@ -158,4 +158,4 @@ global, level=debug ai, level=not set, effective level=debug ai.battle, level=trace, effective level=trace -The same technique is applied to the console colors. If you want to have another debug color for the domain ai, you can explicitely set a color for that domain and level. +The same technique is applied to the console colors. If you want to have another debug color for the domain ai, you can explicitly set a color for that domain and level. diff --git a/docs/developers/Serialization.md b/docs/developers/Serialization.md index 4f805af28..2b582f227 100644 --- a/docs/developers/Serialization.md +++ b/docs/developers/Serialization.md @@ -78,7 +78,7 @@ To make the user-defined type serializable, it has to provide a template method Serializer provides an operator& that is internally expanded to `<<` when serialziing or `>>` when deserializing. -Serializer provides a public bool field `saving`that set to true during serialziation and to false for deserialziation. +Serializer provides a public bool field `saving`that set to true during serialization and to false for deserialization. Typically, serializing class involves serializing all its members (given that they are serializable). Sample: diff --git a/docs/modders/Bonus/Bonus_Types.md b/docs/modders/Bonus/Bonus_Types.md index b94c81bfc..fabf347d6 100644 --- a/docs/modders/Bonus/Bonus_Types.md +++ b/docs/modders/Bonus/Bonus_Types.md @@ -1,4 +1,4 @@ -The bonuses were grouped according to their original purpose. The bonus system allows them to propagate freely betwen the nodes, however they may not be recognized properly beyond the scope of original use. +The bonuses were grouped according to their original purpose. The bonus system allows them to propagate freely between the nodes, however they may not be recognized properly beyond the scope of original use. ## General-purpose bonuses @@ -47,7 +47,7 @@ Bonus that does not account for propagation and gives specific amount of extra r Bonus that does not account for propagation and gives extra resources per day with amount multiplied by number of owned towns - subtype: resource identifier -- val: - base resource amount to be multipled times number of owned towns +- val: - base resource amount to be multiplied times number of owned towns ## Hero bonuses @@ -351,7 +351,7 @@ Negates all natural immunities for affected stacks. (Orb of Vulnerability) In battle, army affected by this bonus will cast spell at the very start of the battle. Spell is always cast at expert level. -- subtype: spell identifer +- subtype: spell identifier - val: duration of the spell, in rounds ### FREE_SHIP_BOARDING @@ -876,7 +876,7 @@ Affected unit receives decreased damage from spells of specific school (Golems) Affected unit receives increased damage from specific spell - val: increase to damage, percentage -- subtype: spell identifer +- subtype: spell identifier ### MIND_IMMUNITY diff --git a/docs/modders/Difficulty.md b/docs/modders/Difficulty.md index 4c4bec5ed..e70a09ca3 100644 --- a/docs/modders/Difficulty.md +++ b/docs/modders/Difficulty.md @@ -13,7 +13,7 @@ Difficulty configuration is located in [config/difficulty.json](../config/diffic { //starting resources "resources": { "wood" : 30, "mercury": 15, "ore": 30, "sulfur": 15, "crystal": 15, "gems": 15, "gold": 30000, "mithril": 0 }, - //bonuses will be given to player globaly + //bonuses will be given to player globally "globalBonuses": [], //bonuses will be given to player every battle "battleBonuses": [] @@ -38,9 +38,9 @@ Difficulty configuration is located in [config/difficulty.json](../config/diffic It's possible to specify bonuses of two types: `globalBonuses` and `battleBonuses`. -Both are arrays containing any amount of bonuses, each can be described as usual bonus. See details in [bonus documenation](Bonus_Format.md). +Both are arrays containing any amount of bonuses, each can be described as usual bonus. See details in [bonus documentation](Bonus_Format.md). -`globalBonuses` are given to player on the begining and depending on bonus configuration, it can behave diffierently. +`globalBonuses` are given to player on the beginning and depending on bonus configuration, it can behave diffierently. `battleBonuses` are given to player during the battles, but *only for battles with neutral forces*. So it won't be provided to player for PvP battles and battles versus AI heroes/castles/garrisons. To avoid cumulative effects or unexpected behavior it's recommended to specify bonus `duration` as `ONE_BATTLE`. diff --git a/docs/modders/Entities_Format/Biome_Format.md b/docs/modders/Entities_Format/Biome_Format.md index de1bb5830..da50664a9 100644 --- a/docs/modders/Entities_Format/Biome_Format.md +++ b/docs/modders/Entities_Format/Biome_Format.md @@ -2,7 +2,7 @@ Biome is a new entity type added in VCMI 1.5.0. It defines a set of random map obstacles which will be generated together. For each zone different obstacle sets is randomized and then only obstacles from that set will be used to fill this zone. -The purpose is to create visually attractive and consistent maps, which will also vary between generations. It is advised to define a biome for a group of objects that look similiar and just fit each other visually. +The purpose is to create visually attractive and consistent maps, which will also vary between generations. It is advised to define a biome for a group of objects that look similar and just fit each other visually. If not enough biomes are defined for [terrain type](Terrain_Format.md), map generator will fall back to using all available templates that match this terrain, which was original behavior before 1.5.0. diff --git a/docs/modders/Entities_Format/Faction_Format.md b/docs/modders/Entities_Format/Faction_Format.md index a7324a956..6fe6c4236 100644 --- a/docs/modders/Entities_Format/Faction_Format.md +++ b/docs/modders/Entities_Format/Faction_Format.md @@ -372,7 +372,7 @@ Each town requires a set of buildings (Around 30-45 buildings) // normal - default value. Fulfill requirements, use resources, spend one day // auto - building appears when all requirements are built // special - building can not be built manually - // grail - building reqires grail to be built + // grail - building requires grail to be built "mode" : "auto", // Buildings which bonuses should be overridden with bonuses of the current building diff --git a/docs/modders/Entities_Format/Hero_Type_Format.md b/docs/modders/Entities_Format/Hero_Type_Format.md index 472bf7153..54c2f9b8f 100644 --- a/docs/modders/Entities_Format/Hero_Type_Format.md +++ b/docs/modders/Entities_Format/Hero_Type_Format.md @@ -44,7 +44,7 @@ In order to make functional hero you also need: // Tooltip visible on clicking icon. Can use {} symbols to change title to yellow // as well as escape sequences "\n" to add line breaks - "tooltip" : "{Magic Arrow}\n\nCasts powerfull magic arrows", + "tooltip" : "{Magic Arrow}\n\nCasts powerful magic arrows", // Name of your specialty "name" : "Magic Arrow" diff --git a/docs/modders/Entities_Format/River_Format.md b/docs/modders/Entities_Format/River_Format.md index 17cbbdf8d..48f29e889 100644 --- a/docs/modders/Entities_Format/River_Format.md +++ b/docs/modders/Entities_Format/River_Format.md @@ -3,7 +3,7 @@ ```jsonc "newRiver" : { - // Two-letters unique indentifier for this river. Used in map format + // Two-letters unique identifier for this river. Used in map format "shortIdentifier" : "mr", // Human-readable name of the river diff --git a/docs/modders/Entities_Format/Road_Format.md b/docs/modders/Entities_Format/Road_Format.md index bc4a85cd7..564264fc0 100644 --- a/docs/modders/Entities_Format/Road_Format.md +++ b/docs/modders/Entities_Format/Road_Format.md @@ -3,7 +3,7 @@ ```jsonc "newRoad" : { - // Two-letters unique indentifier for this road. Used in map format + // Two-letters unique identifier for this road. Used in map format "shortIdentifier" : "mr", // Human-readable name of the road diff --git a/docs/modders/Entities_Format/Terrain_Format.md b/docs/modders/Entities_Format/Terrain_Format.md index 736f7d5a1..287ff4386 100644 --- a/docs/modders/Entities_Format/Terrain_Format.md +++ b/docs/modders/Entities_Format/Terrain_Format.md @@ -3,7 +3,7 @@ ```jsonc "newTerrain" : { - // Two-letters unique indentifier for this terrain. Used in map format + // Two-letters unique identifier for this terrain. Used in map format "shortIdentifier" : "mt", // Human-readable name of the terrain @@ -11,7 +11,7 @@ // Type(s) of this terrain. // WATER - this terrain is water-like terrains that requires boat for movement - // ROCK - this terrain is unpassable "rock" terrain that is used for inacessible parts of underground layer + // ROCK - this terrain is unpassable "rock" terrain that is used for inaccessible parts of underground layer // SUB - this terrain can be placed in underground map layer by RMG // SURFACE - this terrain can be placed in surface map layer by RMG "type" : [ "WATER", "SUB", "ROCK", "SURFACE" ], diff --git a/docs/modders/Map_Editor.md b/docs/modders/Map_Editor.md index 9a430c6a1..5373adca0 100644 --- a/docs/modders/Map_Editor.md +++ b/docs/modders/Map_Editor.md @@ -195,7 +195,7 @@ vcmieditor is independent application so potentially it can be installed just in vcmieditor haven't introduced any change into map format yet, so all maps made by vcmieditor can be easily played with any version of vcmi. At the same time, those maps can be open and read in the old map editor and vice verse - maps from old editor can be imported in the new editor. So, full compatibility is ensured here. -## Mod compatibilty +## Mod compatibility vcmieditor loads set of mods using exactly same mechanism as game uses and mod manipulations can be done using vcmilaucnher application, just enable or disable mods you want and open editor to use content from those mods. In regards on compatibility, of course you need to play maps with same set of mods as you used in the editor. Good part is that is maps don't use content from the mods (even mods were enabled), it can be played on vcmi without mods as well diff --git a/docs/modders/Map_Object_Format.md b/docs/modders/Map_Object_Format.md index 7183c25e8..b2daf6288 100644 --- a/docs/modders/Map_Object_Format.md +++ b/docs/modders/Map_Object_Format.md @@ -50,7 +50,7 @@ Full object consists from 3 parts: { "myCoolObject": { - // Additonal parameters that will be passed over to class that controls behavior of the object + // Additional parameters that will be passed over to class that controls behavior of the object // See object-specific properties of different object types "propertyA" : "value", "propertyB" : 12345 diff --git a/docs/modders/Map_Objects/Rewardable.md b/docs/modders/Map_Objects/Rewardable.md index 571401a70..6be3e3abe 100644 --- a/docs/modders/Map_Objects/Rewardable.md +++ b/docs/modders/Map_Objects/Rewardable.md @@ -200,7 +200,7 @@ This property describes how object state should be reset. Objects without this f ## Appear Chance definition This property describes chance for reward to be selected. When object is initialized on map load, game will roll a "dice" - random number in range 0-99, and pick all awards that have appear chance within selected number. -Note that object that uses appearChance MUST have continious range for every value in 0-99 range. For example, object with 3 different rewards may want to define them as +Note that object that uses appearChance MUST have continuous range for every value in 0-99 range. For example, object with 3 different rewards may want to define them as - `"min" : 0, "max" : 33` - `"min" : 33, "max" : 66` - `"min" : 66, "max" : 100` @@ -410,7 +410,7 @@ Keep in mind, that all randomization is performed on map load and on object rese "type" : "MORALE", "val" : 1, "duration" : "ONE_BATTLE", - "desription" : 94 + "description" : 94 } ] ``` @@ -483,7 +483,7 @@ canLearnSpells - Can be used as limiter - Can be used as reward, to give new creatures to a hero - If hero does not have enough free slots, game will show selection dialog to pick troops to keep -- It is possible to specify probabilty to receive upgraded creature +- It is possible to specify probability to receive upgraded creature ```jsonc "creatures" : [ { diff --git a/docs/modders/Translations.md b/docs/modders/Translations.md index 76c6b8801..170e4fa54 100644 --- a/docs/modders/Translations.md +++ b/docs/modders/Translations.md @@ -140,7 +140,7 @@ In order to display information in Launcher in language selected by user add fol ``` However, normally you don't need to use block for English. Instead, English text should remain in root section of your mod.json file, to be used when game can not find translated version. -### Tranlating in-game strings +### Translating in-game strings After you have exported translation and added mod information for your language, copy exported file to `/Content/config//.json`. diff --git a/docs/players/Bug_Reporting_Guidelines.md b/docs/players/Bug_Reporting_Guidelines.md index 1ca939e36..6ed39fd52 100644 --- a/docs/players/Bug_Reporting_Guidelines.md +++ b/docs/players/Bug_Reporting_Guidelines.md @@ -1,4 +1,4 @@ -First of all, thanks for your support! If you report a bug we can fix it. But keep in mind that reporting your bugs appropriately makes our (developers') lifes easier. Here are a few guidelines that will help you write good bug reports. +First of all, thanks for your support! If you report a bug we can fix it. But keep in mind that reporting your bugs appropriately makes our (developers') lives easier. Here are a few guidelines that will help you write good bug reports. ## Github bugtracker diff --git a/docs/players/Game_Mechanics.md b/docs/players/Game_Mechanics.md index 059f4d45e..561d3fdfc 100644 --- a/docs/players/Game_Mechanics.md +++ b/docs/players/Game_Mechanics.md @@ -4,7 +4,7 @@ VCMI supports resolutions higher than original game, which ran only in 800 x 600. It also allows a number of additional features: -- High-resolution screens of any ascpect ratio are supported. +- High-resolution screens of any aspect ratio are supported. - In-game GUI can be freely scaled - Adventure map can be freely zoomed @@ -27,7 +27,7 @@ The list of implemented cheat codes and console commands is [here](Cheat_codes.m ### Stack Experience module -VCMI natively suppoorts stack experience feature known from WoG. Any creature - old or modded - can get stack experience bonuses. However, this feature needs to be enabled as a part of WoG VCMI submod. +VCMI natively supports stack experience feature known from WoG. Any creature - old or modded - can get stack experience bonuses. However, this feature needs to be enabled as a part of WoG VCMI submod. Stack experience interface has been merged with regular creature window. Among old functionalities, it includes new useful info: @@ -80,7 +80,7 @@ VCMI itroduces custom Quest Log window. It can display info about Seer Hut or Qu ### Power rating -When hovering cursor over neutral stack on adventure map, you may notice additional info about relative threat this stack poses to curently selected hero. This feature has been originally introduced in Heroes of Might and Magic V. +When hovering cursor over neutral stack on adventure map, you may notice additional info about relative threat this stack poses to currently selected hero. This feature has been originally introduced in Heroes of Might and Magic V. ### Minor GUI features @@ -103,7 +103,7 @@ In combat, some creatures, such as Dragon or Cerberi, may attack enemies on mult - [LShift] + LClick – splits a half units from the selected stack into an empty slot. - [LCtrl] + LClick – splits a single unit from the selected stack into an empty slot. - [LCtrl] + [LShift] + LClick – split single units from the selected stack into all empty hero/garrison slots -- [Alt] + LClick – merge all splitted single units into one stack +- [Alt] + LClick – merge all split single units into one stack - [Alt] + [LCtrl] + LClick - move all units of selected stack to the city's garrison or to the met hero - [Alt] + [LShift] + LClick - dismiss selected stack` - Directly type numbers in the Split Stack window to split them in any way you wish diff --git a/docs/players/Installation_Linux.md b/docs/players/Installation_Linux.md index 02f2e18c2..73ea09077 100644 --- a/docs/players/Installation_Linux.md +++ b/docs/players/Installation_Linux.md @@ -95,7 +95,7 @@ Download both files for the "offline backup game installers" and extract them us You can select both downloaded files in launcher to extract automatically. -Alternativly you can use the classic way: +Alternatively you can use the classic way: ``` innoextract --output-dir=~/Downloads/HoMM3 "setup_heroes_of_might_and_magic_3_complete_4.0_(28740).exe" ``` diff --git a/include/vcmi/events/ApplyDamage.h b/include/vcmi/events/ApplyDamage.h index 5ea190e4f..f395e3981 100644 --- a/include/vcmi/events/ApplyDamage.h +++ b/include/vcmi/events/ApplyDamage.h @@ -36,7 +36,7 @@ public: static Sub * getRegistry(); - virtual int64_t getInitalDamage() const = 0; + virtual int64_t getInitialDamage() const = 0; virtual int64_t getDamage() const = 0; virtual void setDamage(int64_t value) = 0; virtual const battle::Unit * getTarget() const = 0; diff --git a/launcher/firstLaunch/firstlaunch_moc.cpp b/launcher/firstLaunch/firstlaunch_moc.cpp index d77790745..050fc2b0c 100644 --- a/launcher/firstLaunch/firstlaunch_moc.cpp +++ b/launcher/firstLaunch/firstlaunch_moc.cpp @@ -363,7 +363,7 @@ void FirstLaunchView::extractGogData() o.extract_unknown = true; o.filenames.set_expand(true); - o.preserve_file_times = true; // also correctly closes file -> without it: on Windows the files are not written completly + o.preserve_file_times = true; // also correctly closes file -> without it: on Windows the files are not written completely process_file(tmpFileExe.toStdString(), o, [this](float progress) { ui->progressBarGog->setValue(progress * 100); diff --git a/launcher/modManager/cmodlist.h b/launcher/modManager/cmodlist.h index 1adf9e5b6..a9c595a08 100644 --- a/launcher/modManager/cmodlist.h +++ b/launcher/modManager/cmodlist.h @@ -50,7 +50,7 @@ public: bool isInstalled() const; // vcmi essential files bool isEssential() const; - // checks if verison is compatible with vcmi + // checks if version is compatible with vcmi bool isCompatible() const; // returns true if mod should be visible in Launcher bool isVisible() const; diff --git a/launcher/modManager/cmodmanager.cpp b/launcher/modManager/cmodmanager.cpp index 363cbe94d..7bd47bcaf 100644 --- a/launcher/modManager/cmodmanager.cpp +++ b/launcher/modManager/cmodmanager.cpp @@ -112,7 +112,7 @@ void CModManager::loadMods() auto json = JsonUtils::toJson(mod); json["localSizeBytes"].Float() = total; if(!name.is_absolute()) - json["storedLocaly"].Bool() = true; + json["storedLocally"].Bool() = true; mod = JsonUtils::toVariant(json); localMods.insert(QString::fromUtf8(modname.c_str()).toLower(), mod); diff --git a/lib/CConsoleHandler.h b/lib/CConsoleHandler.h index aef086329..657a76155 100644 --- a/lib/CConsoleHandler.h +++ b/lib/CConsoleHandler.h @@ -85,7 +85,7 @@ private: static void setColor(EConsoleTextColor::EConsoleTextColor color); //sets color of text appropriate for given logging level - /// FIXME: Implement CConsoleHandler as singleton, move some logic into CLogConsoleTarget, etc... needs to be disussed:) + /// FIXME: Implement CConsoleHandler as singleton, move some logic into CLogConsoleTarget, etc... needs to be discussed:) /// Without static, application will crash complaining about mutex deleted. In short: CConsoleHandler gets deleted before /// the logging system. static std::mutex smx; diff --git a/lib/CCreatureHandler.cpp b/lib/CCreatureHandler.cpp index 9ab628666..0f259f563 100644 --- a/lib/CCreatureHandler.cpp +++ b/lib/CCreatureHandler.cpp @@ -884,15 +884,15 @@ void CCreatureHandler::loadJsonAnimation(CCreature * cre, const JsonNode & graph const JsonNode & missile = graphics["missile"]; const JsonNode & offsets = missile["offset"]; - cre->animation.upperRightMissleOffsetX = static_cast(offsets["upperX"].Float()); - cre->animation.upperRightMissleOffsetY = static_cast(offsets["upperY"].Float()); - cre->animation.rightMissleOffsetX = static_cast(offsets["middleX"].Float()); - cre->animation.rightMissleOffsetY = static_cast(offsets["middleY"].Float()); - cre->animation.lowerRightMissleOffsetX = static_cast(offsets["lowerX"].Float()); - cre->animation.lowerRightMissleOffsetY = static_cast(offsets["lowerY"].Float()); + cre->animation.upperRightMissileOffsetX = static_cast(offsets["upperX"].Float()); + cre->animation.upperRightMissileOffsetY = static_cast(offsets["upperY"].Float()); + cre->animation.rightMissileOffsetX = static_cast(offsets["middleX"].Float()); + cre->animation.rightMissileOffsetY = static_cast(offsets["middleY"].Float()); + cre->animation.lowerRightMissileOffsetX = static_cast(offsets["lowerX"].Float()); + cre->animation.lowerRightMissileOffsetY = static_cast(offsets["lowerY"].Float()); cre->animation.attackClimaxFrame = static_cast(missile["attackClimaxFrame"].Float()); - cre->animation.missleFrameAngles = missile["frameAngles"].convertTo >(); + cre->animation.missileFrameAngles = missile["frameAngles"].convertTo >(); cre->smallIconName = graphics["iconSmall"].String(); cre->largeIconName = graphics["iconLarge"].String(); @@ -1166,7 +1166,7 @@ void CCreatureHandler::loadStackExp(Bonus & b, BonusList & bl, CLegacyConfigPars b.subtype = BonusSubtypeID(SpellID(SpellID::METEOR_SHOWER)); b.additionalInfo = 0;//normal immunity break; - case 'N': //dispell beneficial spells + case 'N': //dispel beneficial spells b.type = BonusType::SPELL_IMMUNITY; b.subtype = BonusSubtypeID(SpellID(SpellID::DISPEL_HELPFUL_SPELLS)); b.additionalInfo = 0;//normal immunity diff --git a/lib/CCreatureHandler.h b/lib/CCreatureHandler.h index d3a391957..782f3adf8 100644 --- a/lib/CCreatureHandler.h +++ b/lib/CCreatureHandler.h @@ -91,10 +91,10 @@ public: double timeBetweenFidgets, idleAnimationTime, walkAnimationTime, attackAnimationTime; - int upperRightMissleOffsetX, rightMissleOffsetX, lowerRightMissleOffsetX, - upperRightMissleOffsetY, rightMissleOffsetY, lowerRightMissleOffsetY; + int upperRightMissileOffsetX, rightMissileOffsetX, lowerRightMissileOffsetX, + upperRightMissileOffsetY, rightMissileOffsetY, lowerRightMissileOffsetY; - std::vector missleFrameAngles; + std::vector missileFrameAngles; int attackClimaxFrame; AnimationPath projectileImageName; diff --git a/lib/CCreatureSet.cpp b/lib/CCreatureSet.cpp index 71c3fb0d5..2a184b8e9 100644 --- a/lib/CCreatureSet.cpp +++ b/lib/CCreatureSet.cpp @@ -257,7 +257,7 @@ TExpType CCreatureSet::getStackExperience(const SlotID & slot) const return 0; //TODO? consider issuing a warning } -bool CCreatureSet::mergableStacks(std::pair & out, const SlotID & preferable) const /*looks for two same stacks, returns slot positions */ +bool CCreatureSet::mergeableStacks(std::pair & out, const SlotID & preferable) const /*looks for two same stacks, returns slot positions */ { //try to match creature to our preferred stack if(preferable.validSlot() && vstd::contains(stacks, preferable)) diff --git a/lib/CCreatureSet.h b/lib/CCreatureSet.h index 51fbbe2ed..df7ab8dd4 100644 --- a/lib/CCreatureSet.h +++ b/lib/CCreatureSet.h @@ -268,7 +268,7 @@ public: TMapCreatureSlot getCreatureMap() const; TCreatureQueue getCreatureQueue(const SlotID & exclude) const; - bool mergableStacks(std::pair & out, const SlotID & preferable = SlotID()) const; //looks for two same stacks, returns slot positions; + bool mergeableStacks(std::pair & out, const SlotID & preferable = SlotID()) const; //looks for two same stacks, returns slot positions; bool validTypes(bool allowUnrandomized = false) const; //checks if all types of creatures are set properly bool slotEmpty(const SlotID & slot) const; int stacksCount() const; diff --git a/lib/CGameInfoCallback.cpp b/lib/CGameInfoCallback.cpp index b8da0482b..f16d2a9c6 100644 --- a/lib/CGameInfoCallback.cpp +++ b/lib/CGameInfoCallback.cpp @@ -82,7 +82,7 @@ const Player * CGameInfoCallback::getPlayer(PlayerColor color) const const PlayerState * CGameInfoCallback::getPlayerState(PlayerColor color, bool verbose) const { - //funtion written from scratch since it's accessed A LOT by AI + //function written from scratch since it's accessed A LOT by AI if(!color.isValidPlayer()) { @@ -624,7 +624,7 @@ EBuildingState CGameInfoCallback::canBuildStructure( const CGTownInstance *t, Bu if (!t->genBuildingRequirements(ID).test(buildTest)) return EBuildingState::PREREQUIRES; - if(t->builded >= VLC->settings()->getInteger(EGameSettings::TOWNS_BUILDINGS_PER_TURN_CAP)) + if(t->built >= VLC->settings()->getInteger(EGameSettings::TOWNS_BUILDINGS_PER_TURN_CAP)) return EBuildingState::CANT_BUILD_TODAY; //building limit //checking resources @@ -715,7 +715,7 @@ bool CGameInfoCallback::isOwnedOrVisited(const CGObjectInstance *obj) const return true; const TerrainTile *t = getTile(obj->visitablePos()); //get entrance tile - const CGObjectInstance *visitor = t->visitableObjects.back(); //visitong hero if present or the obejct itself at last + const CGObjectInstance *visitor = t->visitableObjects.back(); //visitong hero if present or the object itself at last return visitor->ID == Obj::HERO && canGetFullInfo(visitor); //owned or allied hero is a visitor } @@ -781,12 +781,12 @@ int CPlayerSpecificInfoCallback::getHeroSerial(const CGHeroInstance * hero, bool size_t index = 0; auto & heroes = gs->players[*getPlayerID()].heroes; - for (auto & heroe : heroes) + for (auto & hero : heroes) { - if (includeGarrisoned || !(heroe)->inTownGarrison) + if (includeGarrisoned || !(hero)->inTownGarrison) index++; - if (heroe == hero) + if (hero == hero) return static_cast(index); } return -1; @@ -984,7 +984,7 @@ std::vector CGameInfoCallback::getVisibleTeleportObjects(std:: return ids; } -std::vector CGameInfoCallback::getTeleportChannelEntraces(TeleportChannelID id, PlayerColor player) const +std::vector CGameInfoCallback::getTeleportChannelEntrances(TeleportChannelID id, PlayerColor player) const { return getVisibleTeleportObjects(gs->map->teleportChannels[id]->entrances, player); } @@ -996,7 +996,7 @@ std::vector CGameInfoCallback::getTeleportChannelExits(Telepor ETeleportChannelType CGameInfoCallback::getTeleportChannelType(TeleportChannelID id, PlayerColor player) const { - std::vector entrances = getTeleportChannelEntraces(id, player); + std::vector entrances = getTeleportChannelEntrances(id, player); std::vector exits = getTeleportChannelExits(id, player); if((entrances.empty() || exits.empty()) // impassable if exits or entrances list are empty || (entrances.size() == 1 && entrances == exits)) // impassable if only entrance and only exit is same object. e.g bidirectional monolith diff --git a/lib/CGameInfoCallback.h b/lib/CGameInfoCallback.h index 04f264f59..6b9f251a5 100644 --- a/lib/CGameInfoCallback.h +++ b/lib/CGameInfoCallback.h @@ -119,7 +119,7 @@ public: //teleport // std::vector getVisibleTeleportObjects(std::vector ids, PlayerColor player) const; -// std::vector getTeleportChannelEntraces(TeleportChannelID id, PlayerColor Player = PlayerColor::UNFLAGGABLE) const; +// std::vector getTeleportChannelEntrances(TeleportChannelID id, PlayerColor Player = PlayerColor::UNFLAGGABLE) const; // std::vector getTeleportChannelExits(TeleportChannelID id, PlayerColor Player = PlayerColor::UNFLAGGABLE) const; // ETeleportChannelType getTeleportChannelType(TeleportChannelID id, PlayerColor player = PlayerColor::UNFLAGGABLE) const; // bool isTeleportChannelImpassable(TeleportChannelID id, PlayerColor player = PlayerColor::UNFLAGGABLE) const; @@ -221,7 +221,7 @@ public: //teleport virtual std::vector getVisibleTeleportObjects(std::vector ids, PlayerColor player) const; - virtual std::vector getTeleportChannelEntraces(TeleportChannelID id, PlayerColor Player = PlayerColor::UNFLAGGABLE) const; + virtual std::vector getTeleportChannelEntrances(TeleportChannelID id, PlayerColor Player = PlayerColor::UNFLAGGABLE) const; virtual std::vector getTeleportChannelExits(TeleportChannelID id, PlayerColor Player = PlayerColor::UNFLAGGABLE) const; virtual ETeleportChannelType getTeleportChannelType(TeleportChannelID id, PlayerColor player = PlayerColor::UNFLAGGABLE) const; virtual bool isTeleportChannelImpassable(TeleportChannelID id, PlayerColor player = PlayerColor::UNFLAGGABLE) const; diff --git a/lib/CGeneralTextHandler.cpp b/lib/CGeneralTextHandler.cpp index e521b7a94..2f93f783d 100644 --- a/lib/CGeneralTextHandler.cpp +++ b/lib/CGeneralTextHandler.cpp @@ -236,7 +236,7 @@ bool CLegacyConfigParser::isNextEntryEmpty() const { char * nextSymbol = curr; while (nextSymbol < end && *nextSymbol == ' ') - nextSymbol++; //find next meaningfull symbol + nextSymbol++; //find next meaningful symbol return nextSymbol >= end || *nextSymbol == '\n' || *nextSymbol == '\r' || *nextSymbol == '\t'; } @@ -482,7 +482,7 @@ void CGeneralTextHandler::readToVector(const std::string & sourceID, const std:: CGeneralTextHandler::CGeneralTextHandler(): victoryConditions(*this, "core.vcdesc" ), - lossCondtions (*this, "core.lcdesc" ), + lossConditions (*this, "core.lcdesc" ), colors (*this, "core.plcolors" ), tcommands (*this, "core.tcommand" ), hcommands (*this, "core.hallinfo" ), diff --git a/lib/CGeneralTextHandler.h b/lib/CGeneralTextHandler.h index 718fae705..02602bdb1 100644 --- a/lib/CGeneralTextHandler.h +++ b/lib/CGeneralTextHandler.h @@ -281,7 +281,7 @@ public: LegacyTextContainer qeModCommands; LegacyHelpContainer zelp; - LegacyTextContainer lossCondtions; + LegacyTextContainer lossConditions; LegacyTextContainer victoryConditions; //objects diff --git a/lib/CSoundBase.h b/lib/CSoundBase.h index 881296a10..fc686b535 100644 --- a/lib/CSoundBase.h +++ b/lib/CSoundBase.h @@ -184,7 +184,7 @@ VCMI_SOUND_NAME(CGORDefend) VCMI_SOUND_FILE(CGORDFND.wav) \ VCMI_SOUND_NAME(CGORKill) VCMI_SOUND_FILE(CGORKILL.wav) \ VCMI_SOUND_NAME(CGORMove) VCMI_SOUND_FILE(CGORMOVE.wav) \ VCMI_SOUND_NAME(CGORWNCE) VCMI_SOUND_FILE(CGORWNCE.wav) \ -VCMI_SOUND_NAME(chainLigthning) VCMI_SOUND_FILE(CHAINLTE.wav) \ +VCMI_SOUND_NAME(chainLightning) VCMI_SOUND_FILE(CHAINLTE.wav) \ VCMI_SOUND_NAME(chat) VCMI_SOUND_FILE(CHAT.wav) \ VCMI_SOUND_NAME(chest) VCMI_SOUND_FILE(CHEST.wav) \ VCMI_SOUND_NAME(CHMPAttack) VCMI_SOUND_FILE(CHMPATTK.wav) \ @@ -259,7 +259,7 @@ VCMI_SOUND_NAME(Dig) VCMI_SOUND_FILE(DIGSOUND.wav) \ VCMI_SOUND_NAME(DIPMAGK) VCMI_SOUND_FILE(DIPMAGK.wav) \ VCMI_SOUND_NAME(DISEASE) VCMI_SOUND_FILE(DISEASE.wav) \ VCMI_SOUND_NAME(DISGUISE) VCMI_SOUND_FILE(DISGUISE.wav) \ -VCMI_SOUND_NAME(DISPELL) VCMI_SOUND_FILE(DISPELL.wav) \ +VCMI_SOUND_NAME(DISPEL) VCMI_SOUND_FILE(DISPEL.wav) \ VCMI_SOUND_NAME(DISRUPTR) VCMI_SOUND_FILE(DISRUPTR.wav) \ VCMI_SOUND_NAME(dragonHall) VCMI_SOUND_FILE(DRAGON.wav) \ VCMI_SOUND_NAME(DRAINLIF) VCMI_SOUND_FILE(DRAINLIF.wav) \ @@ -817,7 +817,7 @@ VCMI_SOUND_NAME(PLIZShot) VCMI_SOUND_FILE(PLIZSHOT.wav) \ VCMI_SOUND_NAME(PLIZWNCE) VCMI_SOUND_FILE(PLIZWNCE.wav) \ VCMI_SOUND_NAME(POISON) VCMI_SOUND_FILE(POISON.wav) \ VCMI_SOUND_NAME(PRAYER) VCMI_SOUND_FILE(PRAYER.wav) \ -VCMI_SOUND_NAME(PRECISON) VCMI_SOUND_FILE(PRECISON.wav) \ +VCMI_SOUND_NAME(PRECISION) VCMI_SOUND_FILE(PRECISION.wav) \ VCMI_SOUND_NAME(PROTECTA) VCMI_SOUND_FILE(PROTECTA.wav) \ VCMI_SOUND_NAME(PROTECTE) VCMI_SOUND_FILE(PROTECTE.wav) \ VCMI_SOUND_NAME(PROTECTF) VCMI_SOUND_FILE(PROTECTF.wav) \ @@ -842,7 +842,7 @@ VCMI_SOUND_NAME(RDDRMove) VCMI_SOUND_FILE(RDDRMOVE.wav) \ VCMI_SOUND_NAME(RDDRWNCE) VCMI_SOUND_FILE(RDDRWNCE.wav) \ VCMI_SOUND_NAME(REGENER) VCMI_SOUND_FILE(REGENER.wav) \ VCMI_SOUND_NAME(REMoveOB) VCMI_SOUND_FILE(REMOVEOB.wav) \ -VCMI_SOUND_NAME(RESURECT) VCMI_SOUND_FILE(RESURECT.wav) \ +VCMI_SOUND_NAME(RESURRECT) VCMI_SOUND_FILE(RESURRECT.wav) \ VCMI_SOUND_NAME(RGRFAttack) VCMI_SOUND_FILE(RGRFATTK.wav) \ VCMI_SOUND_NAME(RGRFDefend) VCMI_SOUND_FILE(RGRFDFND.wav) \ VCMI_SOUND_NAME(RGRFKill) VCMI_SOUND_FILE(RGRFKILL.wav) \ diff --git a/lib/CStack.h b/lib/CStack.h index 3252a722a..789c58969 100644 --- a/lib/CStack.h +++ b/lib/CStack.h @@ -65,10 +65,10 @@ public: BattleHex::EDir destShiftDir() const; - void prepareAttacked(BattleStackAttacked & bsa, vstd::RNG & rand) const; //requires bsa.damageAmout filled + void prepareAttacked(BattleStackAttacked & bsa, vstd::RNG & rand) const; //requires bsa.damageAmount filled static void prepareAttacked(BattleStackAttacked & bsa, vstd::RNG & rand, - const std::shared_ptr & customState); //requires bsa.damageAmout filled + const std::shared_ptr & customState); //requires bsa.damageAmount filled const CCreature * unitType() const override; int32_t unitBaseAmount() const override; diff --git a/lib/CTownHandler.cpp b/lib/CTownHandler.cpp index f9e0e1473..e1469c526 100644 --- a/lib/CTownHandler.cpp +++ b/lib/CTownHandler.cpp @@ -845,7 +845,7 @@ void CTownHandler::loadSiegeScreen(CTown &town, const JsonNode & source) const VLC->identifiers()->requestIdentifier("creature", source["shooter"], [&town](si32 creature) { auto crId = CreatureID(creature); - if((*VLC->creh)[crId]->animation.missleFrameAngles.empty()) + if((*VLC->creh)[crId]->animation.missileFrameAngles.empty()) logMod->error("Mod '%s' error: Creature '%s' on the Archer's tower is not a shooter. Mod should be fixed. Siege will not work properly!" , town.faction->getNameTranslated() , (*VLC->creh)[crId]->getNameSingularTranslated()); diff --git a/lib/CTownHandler.h b/lib/CTownHandler.h index f3101c7c6..758eac6fe 100644 --- a/lib/CTownHandler.h +++ b/lib/CTownHandler.h @@ -64,7 +64,7 @@ public: BUILD_NORMAL, // 0 - normal, default BUILD_AUTO, // 1 - auto - building appears when all requirements are built BUILD_SPECIAL, // 2 - special - building can not be built normally - BUILD_GRAIL // 3 - grail - building reqires grail to be built + BUILD_GRAIL // 3 - grail - building requires grail to be built } mode; enum ETowerHeight // for lookup towers and some grails @@ -147,7 +147,7 @@ struct DLL_LINKAGE SPuzzleInfo { ui16 number; //type of puzzle si16 x, y; //position - ui16 whenUncovered; //determines the sequnce of discovering (the lesser it is the sooner puzzle will be discovered) + ui16 whenUncovered; //determines the sequence of discovering (the lesser it is the sooner puzzle will be discovered) ImagePath filename; //file with graphic of this puzzle }; diff --git a/lib/IGameEventsReceiver.h b/lib/IGameEventsReceiver.h index 9ee40945a..b428480b7 100644 --- a/lib/IGameEventsReceiver.h +++ b/lib/IGameEventsReceiver.h @@ -105,7 +105,7 @@ public: virtual void receivedResource(){}; virtual void showInfoDialog(EInfoWindowMode type, const std::string & text, const std::vector & components, int soundID){}; virtual void showRecruitmentDialog(const CGDwelling *dwelling, const CArmedInstance *dst, int level, QueryID queryID){} - virtual void showShipyardDialog(const IShipyard *obj){} //obj may be town or shipyard; state: 0 - can buid, 1 - lack of resources, 2 - dest tile is blocked, 3 - no water + virtual void showShipyardDialog(const IShipyard *obj){} //obj may be town or shipyard; state: 0 - can build, 1 - lack of resources, 2 - dest tile is blocked, 3 - no water virtual void showPuzzleMap(){}; virtual void viewWorldMap(){}; diff --git a/lib/MetaString.h b/lib/MetaString.h index 86e91d0cc..d2b5b8a24 100644 --- a/lib/MetaString.h +++ b/lib/MetaString.h @@ -88,7 +88,7 @@ public: void replaceLocalString(EMetaText type, ui32 serial); /// Replaces first '%s' placeholder in string with specified fixed, untranslated string void replaceRawString(const std::string & txt); - /// Repalces first '%s' placeholder with string ID that will be translated in output + /// Replaces first '%s' placeholder with string ID that will be translated in output void replaceTextID(const std::string & value); /// Replaces first '%d' placeholder in string with specified number void replaceNumber(int64_t txt); diff --git a/lib/TextOperations.h b/lib/TextOperations.h index 8b2b1ecba..123efcac1 100644 --- a/lib/TextOperations.h +++ b/lib/TextOperations.h @@ -11,7 +11,7 @@ VCMI_LIB_NAMESPACE_BEGIN -/// Namespace that provides utilites for unicode support (UTF-8) +/// Namespace that provides utilities for unicode support (UTF-8) namespace TextOperations { /// returns 32-bit UTF codepoint for UTF-8 character symbol @@ -24,7 +24,7 @@ namespace TextOperations size_t DLL_LINKAGE getUnicodeCharacterSize(char firstByte); /// test if character is a valid UTF-8 symbol - /// maxSize - maximum number of bytes this symbol may consist from ( = remainer of string) + /// maxSize - maximum number of bytes this symbol may consist from ( = remainder of string) bool DLL_LINKAGE isValidUnicodeCharacter(const char * character, size_t maxSize); /// returns true if text contains valid ASCII-string diff --git a/lib/TurnTimerInfo.cpp b/lib/TurnTimerInfo.cpp index 7bf0b63d5..a4ece9016 100644 --- a/lib/TurnTimerInfo.cpp +++ b/lib/TurnTimerInfo.cpp @@ -22,9 +22,9 @@ bool TurnTimerInfo::isBattleEnabled() const return turnTimer > 0 || baseTimer > 0 || unitTimer > 0 || battleTimer > 0; } -void TurnTimerInfo::substractTimer(int timeMs) +void TurnTimerInfo::subtractTimer(int timeMs) { - auto const & substractTimer = [&timeMs](int & targetTimer) + auto const & subtractTimer = [&timeMs](int & targetTimer) { if (targetTimer > timeMs) { @@ -38,10 +38,10 @@ void TurnTimerInfo::substractTimer(int timeMs) } }; - substractTimer(unitTimer); - substractTimer(battleTimer); - substractTimer(turnTimer); - substractTimer(baseTimer); + subtractTimer(unitTimer); + subtractTimer(battleTimer); + subtractTimer(turnTimer); + subtractTimer(baseTimer); } int TurnTimerInfo::valueMs() const diff --git a/lib/TurnTimerInfo.h b/lib/TurnTimerInfo.h index 697c24831..3627fdcf2 100644 --- a/lib/TurnTimerInfo.h +++ b/lib/TurnTimerInfo.h @@ -28,7 +28,7 @@ struct DLL_LINKAGE TurnTimerInfo bool isEnabled() const; bool isBattleEnabled() const; - void substractTimer(int timeMs); + void subtractTimer(int timeMs); int valueMs() const; bool operator == (const TurnTimerInfo & other) const; diff --git a/lib/VCMIDirs.cpp b/lib/VCMIDirs.cpp index 24b1b45eb..1eaadefc2 100644 --- a/lib/VCMIDirs.cpp +++ b/lib/VCMIDirs.cpp @@ -104,7 +104,7 @@ bool StartBatchCopyDataProgram( ":CLIENT_NOT_RUNNING" "\n" "echo %1% turned off..." "\n" - "echo Attempt to move datas." "\n" + "echo Attempt to move data." "\n" "echo From: %2%" "\n" "echo To: %4%" "\n" "echo Please resolve any conflicts..." "\n" @@ -118,7 +118,7 @@ bool StartBatchCopyDataProgram( "pause" "\n" // Press any key to continue... "goto REMOVE_OLD_DIR" "\n" ")" "\n" - "echo Game data updated succefully." "\n" + "echo Game data updated successfully." "\n" "echo Please update your shortcuts." "\n" "echo Press any key to start a game . . ." "\n" "pause > nul" "\n" @@ -138,7 +138,7 @@ bool StartBatchCopyDataProgram( bathFile << (boost::format(base) % exeName % from % (from / "*.*") % to % startGameString.str()).str(); bathFile.close(); - std::system(("start \"Updating VCMI datas\" /D \"" + to.string() + "\" \"" + bathFilename.string() + '\"').c_str()); + std::system(("start \"Updating VCMI data\" /D \"" + to.string() + "\" \"" + bathFilename.string() + '\"').c_str()); // start won't block std::system // /D start bat in other directory insteand of current directory. @@ -239,7 +239,7 @@ void VCMIDirsWIN32::init() if (bfs::current_path() == from) bfs::current_path(to); - // TODO: Log fact that we moved files succefully. + // TODO: Log fact that we moved files successfully. bfs::remove(from); return true; }; @@ -267,7 +267,7 @@ void VCMIDirsWIN32::init() { const bfs::path executablePath = getModulePath(nullptr); - // VCMI cann't determine executable path. + // VCMI can't determine executable path. // Use standard way to move directory and exit function. if (executablePath.empty()) return moveDirIfExists(from, to); @@ -473,7 +473,7 @@ void VCMIDirsOSX::init() const bfs::path& srcFilePath = file->path(); const bfs::path dstFilePath = to / srcFilePath.filename(); - // TODO: Aplication should ask user what to do when file exists: + // TODO: Application should ask user what to do when file exists: // replace/ignore/stop process/replace all/ignore all if (!bfs::exists(dstFilePath)) bfs::rename(srcFilePath, dstFilePath); diff --git a/lib/battle/BattleInfo.cpp b/lib/battle/BattleInfo.cpp index 820857eac..946499a4a 100644 --- a/lib/battle/BattleInfo.cpp +++ b/lib/battle/BattleInfo.cpp @@ -34,7 +34,7 @@ CStack * BattleInfo::generateNewStack(uint32_t id, const CStackInstance & base, assert(!owner.isValidPlayer() || (base.armyObj && base.armyObj->tempOwner == owner)); auto * ret = new CStack(&base, owner, id, side, slot); - ret->initialPosition = getAvaliableHex(base.getCreatureID(), side, position); //TODO: what if no free tile on battlefield was found? + ret->initialPosition = getAvailableHex(base.getCreatureID(), side, position); //TODO: what if no free tile on battlefield was found? stacks.push_back(ret); return ret; } @@ -265,7 +265,7 @@ BattleInfo * BattleInfo::setupBattle(const int3 & tile, TerrainId terrain, const while(tilesToBlock > 0) { RangeGenerator obidgen(0, VLC->obstacleHandler->size() - 1, ourRand); - auto tileAccessibility = curB->getAccesibility(); + auto tileAccessibility = curB->getAccessibility(); const int obid = obidgen.getSuchNumber(appropriateUsualObstacle); const ObstacleInfo &obi = *Obstacle(obid).getInfo(); @@ -762,7 +762,7 @@ void BattleInfo::setUnitState(uint32_t id, const JsonNode & data, int64_t health if(!changedStack->alive() && healthDelta > 0) { //checking if we resurrect a stack that is under a living stack - auto accessibility = getAccesibility(); + auto accessibility = getAccessibility(); if(!accessibility.accessible(changedStack->getPosition(), changedStack)) { diff --git a/lib/battle/BattleInfo.h b/lib/battle/BattleInfo.h index 589e435f7..58b901fab 100644 --- a/lib/battle/BattleInfo.h +++ b/lib/battle/BattleInfo.h @@ -38,7 +38,7 @@ public: si32 activeStack; const CGTownInstance * town; //used during town siege, nullptr if this is not a siege (note that fortless town IS also a siege) int3 tile; //for background and bonuses - bool creatureBank; //auxilary field, do not serialize + bool creatureBank; //auxiliary field, do not serialize bool replayAllowed; std::vector stacks; std::vector > obstacles; diff --git a/lib/battle/CBattleInfoCallback.cpp b/lib/battle/CBattleInfoCallback.cpp index c5f578412..ee655c995 100644 --- a/lib/battle/CBattleInfoCallback.cpp +++ b/lib/battle/CBattleInfoCallback.cpp @@ -903,7 +903,7 @@ bool CBattleInfoCallback::handleObstacleTriggersForUnit(SpellCastEnvironment & s return unit.alive() && !movementStopped; } -AccessibilityInfo CBattleInfoCallback::getAccesibility() const +AccessibilityInfo CBattleInfoCallback::getAccessibility() const { AccessibilityInfo ret; ret.fill(EAccessibility::ACCESSIBLE); @@ -929,18 +929,18 @@ AccessibilityInfo CBattleInfoCallback::getAccesibility() const //gate -> should be before stacks if(battleGetSiegeLevel() > 0) { - EAccessibility accessability = EAccessibility::ACCESSIBLE; + EAccessibility accessibility = EAccessibility::ACCESSIBLE; switch(battleGetGateState()) { case EGateState::CLOSED: - accessability = EAccessibility::GATE; + accessibility = EAccessibility::GATE; break; case EGateState::BLOCKED: - accessability = EAccessibility::UNAVAILABLE; + accessibility = EAccessibility::UNAVAILABLE; break; } - ret[BattleHex::GATE_OUTER] = ret[BattleHex::GATE_INNER] = accessability; + ret[BattleHex::GATE_OUTER] = ret[BattleHex::GATE_INNER] = accessibility; } //tiles occupied by standing stacks @@ -985,14 +985,14 @@ AccessibilityInfo CBattleInfoCallback::getAccesibility() const return ret; } -AccessibilityInfo CBattleInfoCallback::getAccesibility(const battle::Unit * stack) const +AccessibilityInfo CBattleInfoCallback::getAccessibility(const battle::Unit * stack) const { - return getAccesibility(battle::Unit::getHexes(stack->getPosition(), stack->doubleWide(), stack->unitSide())); + return getAccessibility(battle::Unit::getHexes(stack->getPosition(), stack->doubleWide(), stack->unitSide())); } -AccessibilityInfo CBattleInfoCallback::getAccesibility(const std::vector & accessibleHexes) const +AccessibilityInfo CBattleInfoCallback::getAccessibility(const std::vector & accessibleHexes) const { - auto ret = getAccesibility(); + auto ret = getAccessibility(); for(auto hex : accessibleHexes) if(hex.isValid()) ret[hex] = EAccessibility::ACCESSIBLE; @@ -1145,7 +1145,7 @@ std::pair CBattleInfoCallback::getNearestStack( return std::make_pair(nullptr, BattleHex::INVALID); } -BattleHex CBattleInfoCallback::getAvaliableHex(const CreatureID & creID, ui8 side, int initialPos) const +BattleHex CBattleInfoCallback::getAvailableHex(const CreatureID & creID, ui8 side, int initialPos) const { bool twoHex = VLC->creatures()->getById(creID)->isDoubleWide(); @@ -1160,7 +1160,7 @@ BattleHex CBattleInfoCallback::getAvaliableHex(const CreatureID & creID, ui8 sid pos = GameConstants::BFIELD_WIDTH - 1; //top right } - auto accessibility = getAccesibility(); + auto accessibility = getAccessibility(); std::set occupyable; for(int i = 0; i < accessibility.size(); i++) @@ -1215,13 +1215,13 @@ ReachabilityInfo CBattleInfoCallback::getReachability(const ReachabilityInfo::Pa if(params.flying) return getFlyingReachability(params); else - return makeBFS(getAccesibility(params.knownAccessible), params); + return makeBFS(getAccessibility(params.knownAccessible), params); } ReachabilityInfo CBattleInfoCallback::getFlyingReachability(const ReachabilityInfo::Parameters ¶ms) const { ReachabilityInfo ret; - ret.accessibility = getAccesibility(params.knownAccessible); + ret.accessibility = getAccessibility(params.knownAccessible); for(int i = 0; i < GameConstants::BFIELD_SIZE; i++) { diff --git a/lib/battle/CBattleInfoCallback.h b/lib/battle/CBattleInfoCallback.h index b1a16ef1f..f9fe241a7 100644 --- a/lib/battle/CBattleInfoCallback.h +++ b/lib/battle/CBattleInfoCallback.h @@ -134,12 +134,12 @@ public: ReachabilityInfo getReachability(const battle::Unit * unit) const; ReachabilityInfo getReachability(const ReachabilityInfo::Parameters & params) const; - AccessibilityInfo getAccesibility() const; - AccessibilityInfo getAccesibility(const battle::Unit * stack) const; //Hexes ocupied by stack will be marked as accessible. - AccessibilityInfo getAccesibility(const std::vector & accessibleHexes) const; //given hexes will be marked as accessible + AccessibilityInfo getAccessibility() const; + AccessibilityInfo getAccessibility(const battle::Unit * stack) const; //Hexes occupied by stack will be marked as accessible. + AccessibilityInfo getAccessibility(const std::vector & accessibleHexes) const; //given hexes will be marked as accessible std::pair getNearestStack(const battle::Unit * closest) const; - BattleHex getAvaliableHex(const CreatureID & creID, ui8 side, int initialPos = -1) const; //find place for adding new stack + BattleHex getAvailableHex(const CreatureID & creID, ui8 side, int initialPos = -1) const; //find place for adding new stack protected: ReachabilityInfo getFlyingReachability(const ReachabilityInfo::Parameters & params) const; ReachabilityInfo makeBFS(const AccessibilityInfo & accessibility, const ReachabilityInfo::Parameters & params) const; diff --git a/lib/battle/CUnitState.cpp b/lib/battle/CUnitState.cpp index 860d8e576..bb58a08cf 100644 --- a/lib/battle/CUnitState.cpp +++ b/lib/battle/CUnitState.cpp @@ -140,7 +140,7 @@ int32_t CRetaliations::total() const if(noRetaliation.getHasBonus()) return 0; - //after dispell bonus should remain during current round + //after dispel bonus should remain during current round int32_t val = 1 + totalProxy->totalValue(); vstd::amax(totalCache, val); return totalCache; @@ -804,8 +804,8 @@ void CUnitState::save(JsonNode & data) { //TODO: use instance resolver data.clear(); - JsonSerializer ser(nullptr, data); - ser.serializeStruct("state", *this); + JsonSerializer set(nullptr, data); + set.serializeStruct("state", *this); } void CUnitState::load(const JsonNode & data) diff --git a/lib/battle/ReachabilityInfo.h b/lib/battle/ReachabilityInfo.h index 8f6bbb663..7c872ad86 100644 --- a/lib/battle/ReachabilityInfo.h +++ b/lib/battle/ReachabilityInfo.h @@ -15,7 +15,7 @@ VCMI_LIB_NAMESPACE_BEGIN // Reachability info is result of BFS calculation. It's dependent on stack (it's owner, whether it's flying), -// startPosition and perpective. +// startPosition and perspective. struct DLL_LINKAGE ReachabilityInfo { using TDistances = std::array; diff --git a/lib/bonuses/BonusEnum.cpp b/lib/bonuses/BonusEnum.cpp index e48d15dcf..4c50e7011 100644 --- a/lib/bonuses/BonusEnum.cpp +++ b/lib/bonuses/BonusEnum.cpp @@ -42,7 +42,7 @@ const std::map bonusDurationMap = BONUS_ITEM(STACK_GETS_TURN) BONUS_ITEM(COMMANDER_KILLED) BONUS_ITEM(UNTIL_OWN_ATTACK) - { "UNITL_BEING_ATTACKED", BonusDuration::UNTIL_BEING_ATTACKED }//typo, but used in some mods + { "UNTIL_BEING_ATTACKED", BonusDuration::UNTIL_BEING_ATTACKED }//typo, but used in some mods }; #undef BONUS_ITEM diff --git a/lib/bonuses/BonusEnum.h b/lib/bonuses/BonusEnum.h index 524dcd9fd..a55b0b06b 100644 --- a/lib/bonuses/BonusEnum.h +++ b/lib/bonuses/BonusEnum.h @@ -33,7 +33,7 @@ class JsonNode; BONUS_NAME(NEGATE_ALL_NATURAL_IMMUNITIES) \ BONUS_NAME(STACK_HEALTH) \ BONUS_NAME(GENERATE_RESOURCE) /*daily value, uses subtype (resource type)*/ \ - BONUS_NAME(CREATURE_GROWTH) /*for legion artifacts: value - week growth bonus, subtype - monster level if aplicable*/ \ + BONUS_NAME(CREATURE_GROWTH) /*for legion artifacts: value - week growth bonus, subtype - monster level if applicable*/ \ BONUS_NAME(WHIRLPOOL_PROTECTION) /*hero won't lose army when teleporting through whirlpool*/ \ BONUS_NAME(SPELL) /*hero knows spell, val - skill level (0 - 3), subtype - spell id*/ \ BONUS_NAME(SPELLS_OF_LEVEL) /*hero knows all spells of given level, val - skill level; subtype - level*/ \ @@ -177,7 +177,7 @@ class JsonNode; BONUS_NAME(ENEMY_ATTACK_REDUCTION) /*in % (value) eg. Nix (HotA)*/ \ BONUS_NAME(REVENGE) /*additional damage based on how many units in stack died - formula: sqrt((number of creatures at battle start + 1) * creature health) / (total health now + 1 creature health) - 1) * 100% */ \ BONUS_NAME(RESOURCES_CONSTANT_BOOST) /*Bonus that does not account for propagation and gives extra resources per day. val - resource amount, subtype - resource type*/ \ - BONUS_NAME(RESOURCES_TOWN_MULTIPLYING_BOOST) /*Bonus that does not account for propagation and gives extra resources per day with amount multiplied by number of owned towns. val - base resource amount to be multipled times number of owned towns, subtype - resource type*/ \ + BONUS_NAME(RESOURCES_TOWN_MULTIPLYING_BOOST) /*Bonus that does not account for propagation and gives extra resources per day with amount multiplied by number of owned towns. val - base resource amount to be multiplied times number of owned towns, subtype - resource type*/ \ /* end of list */ diff --git a/lib/bonuses/CBonusSystemNode.h b/lib/bonuses/CBonusSystemNode.h index a1eef1627..b1e39238f 100644 --- a/lib/bonuses/CBonusSystemNode.h +++ b/lib/bonuses/CBonusSystemNode.h @@ -47,7 +47,7 @@ private: static std::atomic treeChanged; // Setting a value to cachingStr before getting any bonuses caches the result for later requests. - // This string needs to be unique, that's why it has to be setted in the following manner: + // This string needs to be unique, that's why it has to be set in the following manner: // [property key]_[value] => only for selector mutable std::map cachedRequests; mutable boost::mutex sync; @@ -85,7 +85,7 @@ public: virtual ~CBonusSystemNode(); void limitBonuses(const BonusList &allBonuses, BonusList &out) const; //out will bo populed with bonuses that are not limited here - TBonusListPtr limitBonuses(const BonusList &allBonuses) const; //same as above, returns out by val for convienence + TBonusListPtr limitBonuses(const BonusList &allBonuses) const; //same as above, returns out by val for convenience TConstBonusListPtr getAllBonuses(const CSelector &selector, const CSelector &limit, const CBonusSystemNode *root = nullptr, const std::string &cachingStr = "") const override; void getParents(TCNodes &out) const; //retrieves list of parent nodes (nodes to inherit bonuses from), diff --git a/lib/campaign/CampaignHandler.cpp b/lib/campaign/CampaignHandler.cpp index 5aed7fe91..89623fd52 100644 --- a/lib/campaign/CampaignHandler.cpp +++ b/lib/campaign/CampaignHandler.cpp @@ -151,7 +151,7 @@ void CampaignHandler::readHeaderFromJson(CampaignHeader & ret, JsonNode & reader ret.numberOfScenarios = reader["scenarios"].Vector().size(); ret.name.appendTextID(reader["name"].String()); ret.description.appendTextID(reader["description"].String()); - ret.difficultyChoosenByPlayer = reader["allowDifficultySelection"].Bool(); + ret.difficultyChosenByPlayer = reader["allowDifficultySelection"].Bool(); ret.music = AudioPath::fromJson(reader["music"]); ret.filename = filename; ret.modName = modName; @@ -386,9 +386,9 @@ void CampaignHandler::readHeaderFromMemory( CampaignHeader & ret, CBinaryReader ret.name.appendTextID(readLocalizedString(ret, reader, filename, modName, encoding, "name")); ret.description.appendTextID(readLocalizedString(ret, reader, filename, modName, encoding, "description")); if (ret.version > CampaignVersion::RoE) - ret.difficultyChoosenByPlayer = reader.readInt8(); + ret.difficultyChosenByPlayer = reader.readInt8(); else - ret.difficultyChoosenByPlayer = false; + ret.difficultyChosenByPlayer = false; ret.music = prologMusicName(reader.readInt8()); ret.filename = filename; diff --git a/lib/campaign/CampaignState.cpp b/lib/campaign/CampaignState.cpp index 335722d24..aa1da37e2 100644 --- a/lib/campaign/CampaignState.cpp +++ b/lib/campaign/CampaignState.cpp @@ -126,7 +126,7 @@ void CampaignHeader::loadLegacyData(ui8 campId) bool CampaignHeader::playerSelectedDifficulty() const { - return difficultyChoosenByPlayer; + return difficultyChosenByPlayer; } bool CampaignHeader::formatVCMI() const diff --git a/lib/campaign/CampaignState.h b/lib/campaign/CampaignState.h index c34be09eb..2e66c0567 100644 --- a/lib/campaign/CampaignState.h +++ b/lib/campaign/CampaignState.h @@ -87,7 +87,7 @@ class DLL_LINKAGE CampaignHeader : public boost::noncopyable std::string encoding; int numberOfScenarios = 0; - bool difficultyChoosenByPlayer = false; + bool difficultyChosenByPlayer = false; void loadLegacyData(ui8 campId); @@ -114,7 +114,7 @@ public: h & numberOfScenarios; h & name; h & description; - h & difficultyChoosenByPlayer; + h & difficultyChosenByPlayer; h & filename; h & modName; h & music; diff --git a/lib/events/ApplyDamage.cpp b/lib/events/ApplyDamage.cpp index 82e499cd9..95930f3a0 100644 --- a/lib/events/ApplyDamage.cpp +++ b/lib/events/ApplyDamage.cpp @@ -29,7 +29,7 @@ CApplyDamage::CApplyDamage(const Environment * env_, BattleStackAttacked * pack_ : pack(pack_), target(std::move(target_)) { - initalDamage = pack->damageAmount; + initialDamage = pack->damageAmount; } bool CApplyDamage::isEnabled() const @@ -37,9 +37,9 @@ bool CApplyDamage::isEnabled() const return true; } -int64_t CApplyDamage::getInitalDamage() const +int64_t CApplyDamage::getInitialDamage() const { - return initalDamage; + return initialDamage; } int64_t CApplyDamage::getDamage() const diff --git a/lib/events/ApplyDamage.h b/lib/events/ApplyDamage.h index a7a426c45..3fbcda8a3 100644 --- a/lib/events/ApplyDamage.h +++ b/lib/events/ApplyDamage.h @@ -23,12 +23,12 @@ public: CApplyDamage(const Environment * env_, BattleStackAttacked * pack_, std::shared_ptr target_); bool isEnabled() const override; - int64_t getInitalDamage() const override; + int64_t getInitialDamage() const override; int64_t getDamage() const override; void setDamage(int64_t value) override; const battle::Unit * getTarget() const override; private: - int64_t initalDamage; + int64_t initialDamage; BattleStackAttacked * pack; std::shared_ptr target; diff --git a/lib/filesystem/CCompressedStream.h b/lib/filesystem/CCompressedStream.h index 2fad04ebb..239c20050 100644 --- a/lib/filesystem/CCompressedStream.h +++ b/lib/filesystem/CCompressedStream.h @@ -103,8 +103,8 @@ public: /** * C-tor. * - * @param stream - stream with compresed data - * @param gzip - this is gzipp'ed file e.g. campaign or maps, false for files in lod + * @param stream - stream with compressed data + * @param gzip - this is gzipp'ed file e.g. campaign or maps, false for files in load * @param decompressedSize - optional parameter to hint size of decompressed data */ CCompressedStream(std::unique_ptr stream, bool gzip, size_t decompressedSize=0); @@ -136,7 +136,7 @@ private: enum EState { - ERROR_OCCURED, + ERROR_OCCURRED, INITIALIZED, IN_PROGRESS, STREAM_END, diff --git a/lib/filesystem/Filesystem.h b/lib/filesystem/Filesystem.h index 1ead410f1..532a3b2e7 100644 --- a/lib/filesystem/Filesystem.h +++ b/lib/filesystem/Filesystem.h @@ -101,7 +101,7 @@ public: static void addFilesystem(const std::string & parent, const std::string & identifier, ISimpleResourceLoader * loader); /** - * @brief removeFilesystem removes previously added filesystem from global resouce holder + * @brief removeFilesystem removes previously added filesystem from global resource holder * @param parent parent loader containing filesystem * @param identifier name of this loader * @return if filesystem was successfully removed diff --git a/lib/filesystem/ISimpleResourceLoader.h b/lib/filesystem/ISimpleResourceLoader.h index 836a3a505..06b7c9a65 100644 --- a/lib/filesystem/ISimpleResourceLoader.h +++ b/lib/filesystem/ISimpleResourceLoader.h @@ -25,7 +25,7 @@ public: /** * Loads a resource with the given resource name. * - * @param resourceName The unqiue resource name in space of the archive. + * @param resourceName The unique resource name in space of the archive. * @return a input stream object */ virtual std::unique_ptr load(const ResourcePath & resourceName) const = 0; diff --git a/lib/gameState/CGameState.cpp b/lib/gameState/CGameState.cpp index e5cb5da93..66fb50262 100644 --- a/lib/gameState/CGameState.cpp +++ b/lib/gameState/CGameState.cpp @@ -1968,7 +1968,7 @@ ArtifactID CGameState::pickRandomArtifact(CRandomGenerator & rand, int flags, st { std::set potentialPicks; - // Select artifacts that satisfy provided criterias + // Select artifacts that satisfy provided criteria for (auto const & artifactID : map->allowedArtifact) { if (!VLC->arth->legalArtifact(artifactID)) diff --git a/lib/gameState/CGameState.h b/lib/gameState/CGameState.h index 17bd55cf5..9cd3fc312 100644 --- a/lib/gameState/CGameState.h +++ b/lib/gameState/CGameState.h @@ -237,7 +237,7 @@ private: CRandomGenerator rand; Services * services; - /// Ponter to campaign state manager. Nullptr for single scenarios + /// Pointer to campaign state manager. Nullptr for single scenarios std::unique_ptr campaign; friend class IGameCallback; diff --git a/lib/gameState/CGameStateCampaign.cpp b/lib/gameState/CGameStateCampaign.cpp index ea4f6d72e..c496db471 100644 --- a/lib/gameState/CGameStateCampaign.cpp +++ b/lib/gameState/CGameStateCampaign.cpp @@ -545,11 +545,11 @@ void CGameStateCampaign::initHeroes() } else //specific hero { - for (auto & heroe : heroes) + for (auto & hero : heroes) { - if (heroe->getHeroType().getNum() == chosenBonus->info1) + if (hero->getHeroType().getNum() == chosenBonus->info1) { - giveCampaignBonusToHero(heroe); + giveCampaignBonusToHero(hero); break; } } diff --git a/lib/gameState/InfoAboutArmy.cpp b/lib/gameState/InfoAboutArmy.cpp index f5c807fe5..cc3bdc205 100644 --- a/lib/gameState/InfoAboutArmy.cpp +++ b/lib/gameState/InfoAboutArmy.cpp @@ -166,7 +166,7 @@ void InfoAboutTown::initFromTown(const CGTownInstance *t, bool detailed) { initFromArmy(t, detailed); army = ArmyDescriptor(t->getUpperArmy(), detailed); - built = t->builded; + built = t->built; fortLevel = t->fortLevel(); name = t->getNameTranslated(); tType = t->getTown(); diff --git a/lib/gameState/SThievesGuildInfo.h b/lib/gameState/SThievesGuildInfo.h index 6e4c06aeb..95776621d 100644 --- a/lib/gameState/SThievesGuildInfo.h +++ b/lib/gameState/SThievesGuildInfo.h @@ -20,7 +20,7 @@ struct DLL_LINKAGE SThievesGuildInfo std::vector< std::vector< PlayerColor > > numOfTowns, numOfHeroes, gold, woodOre, mercSulfCrystGems, obelisks, artifacts, army, income; // [place] -> [colours of players] - std::map colorToBestHero; //maps player's color to his best heros' + std::map colorToBestHero; //maps player's color to his best heroes' std::map personality; // color to personality // ai tactic std::map bestCreature; // color to ID // id or -1 if not known diff --git a/lib/gameState/TavernHeroesPool.h b/lib/gameState/TavernHeroesPool.h index cc77d22d1..ec92dfe52 100644 --- a/lib/gameState/TavernHeroesPool.h +++ b/lib/gameState/TavernHeroesPool.h @@ -54,7 +54,7 @@ class DLL_LINKAGE TavernHeroesPool : public Serializeable public: ~TavernHeroesPool(); - /// Returns heroes currently availabe in tavern of a specific player + /// Returns heroes currently available in tavern of a specific player std::vector getHeroesFor(PlayerColor color) const; /// returns heroes in pool without heroes that are available in taverns diff --git a/lib/json/JsonNode.cpp b/lib/json/JsonNode.cpp index 17fbe4406..32712c85a 100644 --- a/lib/json/JsonNode.cpp +++ b/lib/json/JsonNode.cpp @@ -26,7 +26,7 @@ Node & resolvePointer(Node & in, const std::string & pointer) size_t splitPos = pointer.find('/', 1); std::string entry = pointer.substr(1, splitPos - 1); - std::string remainer = splitPos == std::string::npos ? "" : pointer.substr(splitPos); + std::string remainder = splitPos == std::string::npos ? "" : pointer.substr(splitPos); if(in.getType() == VCMI_LIB_WRAP_NAMESPACE(JsonNode)::JsonType::DATA_VECTOR) { @@ -39,9 +39,9 @@ Node & resolvePointer(Node & in, const std::string & pointer) auto index = boost::lexical_cast(entry); if(in.Vector().size() > index) - return in.Vector()[index].resolvePointer(remainer); + return in.Vector()[index].resolvePointer(remainder); } - return in[entry].resolvePointer(remainer); + return in[entry].resolvePointer(remainder); } VCMI_LIB_NAMESPACE_BEGIN diff --git a/lib/json/JsonUtils.h b/lib/json/JsonUtils.h index 7f550b916..954ee0b16 100644 --- a/lib/json/JsonUtils.h +++ b/lib/json/JsonUtils.h @@ -65,7 +65,7 @@ namespace JsonUtils * @param node - JsonNode to check * @param schemaName - name of schema to use * @param dataName - some way to identify data (printed in console in case of errors) - * @returns true if data in node fully compilant with schema + * @returns true if data in node fully compliant with schema */ DLL_LINKAGE bool validate(const JsonNode & node, const std::string & schemaName, const std::string & dataName); diff --git a/lib/json/JsonValidator.h b/lib/json/JsonValidator.h index 562559dba..c302d99c2 100644 --- a/lib/json/JsonValidator.h +++ b/lib/json/JsonValidator.h @@ -13,7 +13,7 @@ VCMI_LIB_NAMESPACE_BEGIN -/// Class for Json validation. Mostly compilant with json-schema v6 draf +/// Class for Json validation. Mostly compliant with json-schema v6 draf struct JsonValidator { /// path from root node to current one. diff --git a/lib/mapObjectConstructors/CBankInstanceConstructor.cpp b/lib/mapObjectConstructors/CBankInstanceConstructor.cpp index ffac95bbc..f1f6a5c84 100644 --- a/lib/mapObjectConstructors/CBankInstanceConstructor.cpp +++ b/lib/mapObjectConstructors/CBankInstanceConstructor.cpp @@ -132,7 +132,7 @@ std::vector> CBankInfo::getPossibleCreatur { JsonRandom::Variables emptyVariables; JsonRandom randomizer(cb); - std::vector> aproximateReward; + std::vector> approximateReward; for(const JsonNode & configEntry : config) { @@ -143,11 +143,11 @@ std::vector> CBankInfo::getPossibleCreatur { const auto * creature = stack.allowedCreatures.front(); - aproximateReward.emplace_back(configEntry["chance"].Integer(), CStackBasicDescriptor(creature, (stack.minAmount + stack.maxAmount) / 2)); + approximateReward.emplace_back(configEntry["chance"].Integer(), CStackBasicDescriptor(creature, (stack.minAmount + stack.maxAmount) / 2)); } } - return aproximateReward; + return approximateReward; } bool CBankInfo::givesResources() const diff --git a/lib/mapObjectConstructors/CObjectClassesHandler.h b/lib/mapObjectConstructors/CObjectClassesHandler.h index b1cb1ca64..d65d2b38c 100644 --- a/lib/mapObjectConstructors/CObjectClassesHandler.h +++ b/lib/mapObjectConstructors/CObjectClassesHandler.h @@ -72,7 +72,7 @@ class DLL_LINKAGE CObjectClassesHandler : public IHandlerBase, boost::noncopyabl /// list of object handlers, each of them handles only one type std::vector< std::unique_ptr > objects; - /// map that is filled during contruction with all known handlers. Not serializeable due to usage of std::function + /// map that is filled during construction with all known handlers. Not serializeable due to usage of std::function std::map > handlerConstructors; /// container with H3 templates, used only during loading, no need to serialize it diff --git a/lib/mapObjectConstructors/CRewardableConstructor.cpp b/lib/mapObjectConstructors/CRewardableConstructor.cpp index 83f24b01e..abe3552b5 100644 --- a/lib/mapObjectConstructors/CRewardableConstructor.cpp +++ b/lib/mapObjectConstructors/CRewardableConstructor.cpp @@ -58,7 +58,7 @@ void CRewardableConstructor::configureObject(CGObjectInstance * object, CRandomG if (objectInfo.getParameters()["rewards"].isNull()) logMod->error("Object %s has invalid configuration! No defined rewards found!", getJsonKey()); else - logMod->error("Object %s has invalid configuration! Make sure that defined appear chances are continious!", getJsonKey()); + logMod->error("Object %s has invalid configuration! Make sure that defined appear chances are continuous!", getJsonKey()); } } } diff --git a/lib/mapObjects/CGCreature.cpp b/lib/mapObjects/CGCreature.cpp index 4c4a1d3b8..a2da0ef3c 100644 --- a/lib/mapObjects/CGCreature.cpp +++ b/lib/mapObjects/CGCreature.cpp @@ -227,7 +227,7 @@ void CGCreature::pickRandomObject(CRandomGenerator & rand) { // Try to generate some debug information if sanity check failed CreatureID creatureID(subID.getNum()); - throw std::out_of_range("Failed to find handler for creature " + std::to_string(creatureID.getNum()) + ", identifer:" + creatureID.toEntity(VLC)->getJsonKey()); + throw std::out_of_range("Failed to find handler for creature " + std::to_string(creatureID.getNum()) + ", identifier:" + creatureID.toEntity(VLC)->getJsonKey()); } ID = MapObjectID::MONSTER; diff --git a/lib/mapObjects/CGDwelling.cpp b/lib/mapObjects/CGDwelling.cpp index 5375a39ec..4b67b2c76 100644 --- a/lib/mapObjects/CGDwelling.cpp +++ b/lib/mapObjects/CGDwelling.cpp @@ -430,7 +430,7 @@ void CGDwelling::heroAcceptsCreatures( const CGHeroInstance *h) const if(!testSlot.validSlot()) //no available slot - try merging army of visiting hero { std::pair toMerge; - if (h->mergableStacks(toMerge)) + if (h->mergeableStacks(toMerge)) { cb->moveStack(StackLocation(h, toMerge.first), StackLocation(h, toMerge.second), -1); //merge toMerge.first into toMerge.second assert(!h->hasStackAtSlot(toMerge.first)); //we have now a new free slot diff --git a/lib/mapObjects/CGTownBuilding.cpp b/lib/mapObjects/CGTownBuilding.cpp index 6efd84e31..e87988df4 100644 --- a/lib/mapObjects/CGTownBuilding.cpp +++ b/lib/mapObjects/CGTownBuilding.cpp @@ -404,7 +404,7 @@ void CTownRewardableBuilding::grantReward(ui32 rewardID, const CGHeroInstance * grantRewardBeforeLevelup(cb, configuration.info.at(rewardID), hero); - // hero is not blocked by levelup dialog - grant remainer immediately + // hero is not blocked by levelup dialog - grant remainder immediately if(!cb->isVisitCoveredByAnotherQuery(town, hero)) { grantRewardAfterLevelup(cb, configuration.info.at(rewardID), town, hero); diff --git a/lib/mapObjects/CGTownInstance.cpp b/lib/mapObjects/CGTownInstance.cpp index 71784c48e..f61e84abc 100644 --- a/lib/mapObjects/CGTownInstance.cpp +++ b/lib/mapObjects/CGTownInstance.cpp @@ -230,7 +230,7 @@ bool CGTownInstance::hasCapitol() const CGTownInstance::CGTownInstance(IGameCallback *cb): CGDwelling(cb), town(nullptr), - builded(0), + built(0), destroyed(0), identifier(0), alignmentToPlayer(PlayerColor::NEUTRAL) diff --git a/lib/mapObjects/CGTownInstance.h b/lib/mapObjects/CGTownInstance.h index f8fd3f8e3..4eeb5a069 100644 --- a/lib/mapObjects/CGTownInstance.h +++ b/lib/mapObjects/CGTownInstance.h @@ -52,7 +52,7 @@ public: CTownAndVisitingHero townAndVis; const CTown * town; - si32 builded; //how many buildings has been built this turn + si32 built; //how many buildings has been built this turn si32 destroyed; //how many buildings has been destroyed this turn ConstTransitivePtr garrisonHero, visitingHero; ui32 identifier; //special identifier from h3m (only > RoE maps) @@ -71,7 +71,7 @@ public: { h & static_cast(*this); h & nameTextId; - h & builded; + h & built; h & destroyed; h & identifier; h & garrisonHero; diff --git a/lib/mapObjects/CRewardableObject.cpp b/lib/mapObjects/CRewardableObject.cpp index 9bc4126e7..0354b1b12 100644 --- a/lib/mapObjects/CRewardableObject.cpp +++ b/lib/mapObjects/CRewardableObject.cpp @@ -43,7 +43,7 @@ void CRewardableObject::grantRewardWithMessage(const CGHeroInstance * contextHer grantReward(index, contextHero); } -void CRewardableObject::selectRewardWthMessage(const CGHeroInstance * contextHero, const std::vector & rewardIndices, const MetaString & dialog) const +void CRewardableObject::selectRewardWithMessage(const CGHeroInstance * contextHero, const std::vector & rewardIndices, const MetaString & dialog) const { BlockingDialog sd(configuration.canRefuse, rewardIndices.size() > 1); sd.player = contextHero->tempOwner; @@ -53,7 +53,7 @@ void CRewardableObject::selectRewardWthMessage(const CGHeroInstance * contextHer } -void CRewardableObject::grantAllRewardsWthMessage(const CGHeroInstance * contextHero, const std::vector & rewardIndices, bool markAsVisit) const +void CRewardableObject::grantAllRewardsWithMessage(const CGHeroInstance * contextHero, const std::vector & rewardIndices, bool markAsVisit) const { if (rewardIndices.empty()) return; @@ -115,7 +115,7 @@ void CRewardableObject::onHeroVisit(const CGHeroInstance *h) const case 1: // one reward. Just give it with message { if (configuration.canRefuse) - selectRewardWthMessage(h, rewards, configuration.info.at(rewards.front()).message); + selectRewardWithMessage(h, rewards, configuration.info.at(rewards.front()).message); else grantRewardWithMessage(h, rewards.front(), true); break; @@ -124,11 +124,11 @@ void CRewardableObject::onHeroVisit(const CGHeroInstance *h) const { switch (configuration.selectMode) { case Rewardable::SELECT_PLAYER: // player must select - selectRewardWthMessage(h, rewards, configuration.onSelect); + selectRewardWithMessage(h, rewards, configuration.onSelect); break; case Rewardable::SELECT_FIRST: // give first available if (configuration.canRefuse) - selectRewardWthMessage(h, { rewards.front() }, configuration.info.at(rewards.front()).message); + selectRewardWithMessage(h, { rewards.front() }, configuration.info.at(rewards.front()).message); else grantRewardWithMessage(h, rewards.front(), true); break; @@ -136,13 +136,13 @@ void CRewardableObject::onHeroVisit(const CGHeroInstance *h) const { ui32 rewardIndex = *RandomGeneratorUtil::nextItem(rewards, cb->gameState()->getRandomGenerator()); if (configuration.canRefuse) - selectRewardWthMessage(h, { rewardIndex }, configuration.info.at(rewardIndex).message); + selectRewardWithMessage(h, { rewardIndex }, configuration.info.at(rewardIndex).message); else grantRewardWithMessage(h, rewardIndex, true); break; } case Rewardable::SELECT_ALL: // grant all possible - grantAllRewardsWthMessage(h, rewards, true); + grantAllRewardsWithMessage(h, rewards, true); break; } break; @@ -208,7 +208,7 @@ void CRewardableObject::grantReward(ui32 rewardID, const CGHeroInstance * hero) cb->setObjPropertyValue(id, ObjProperty::REWARD_SELECT, rewardID); grantRewardBeforeLevelup(cb, configuration.info.at(rewardID), hero); - // hero is not blocked by levelup dialog - grant remainer immediately + // hero is not blocked by levelup dialog - grant remainder immediately if(!cb->isVisitCoveredByAnotherQuery(this, hero)) { grantRewardAfterLevelup(cb, configuration.info.at(rewardID), this, hero); diff --git a/lib/mapObjects/CRewardableObject.h b/lib/mapObjects/CRewardableObject.h index 1a7cea319..0b0ddf5ff 100644 --- a/lib/mapObjects/CRewardableObject.h +++ b/lib/mapObjects/CRewardableObject.h @@ -15,7 +15,7 @@ VCMI_LIB_NAMESPACE_BEGIN /// Base class that can handle granting rewards to visiting heroes. -/// Inherits from CArmedInstance for proper trasfer of armies +/// Inherits from CArmedInstance for proper transfer of armies class DLL_LINKAGE CRewardableObject : public CArmedInstance, public Rewardable::Interface { protected: @@ -35,9 +35,9 @@ protected: void serializeJsonOptions(JsonSerializeFormat & handler) override; virtual void grantRewardWithMessage(const CGHeroInstance * contextHero, int rewardIndex, bool markAsVisit) const; - virtual void selectRewardWthMessage(const CGHeroInstance * contextHero, const std::vector & rewardIndices, const MetaString & dialog) const; + virtual void selectRewardWithMessage(const CGHeroInstance * contextHero, const std::vector & rewardIndices, const MetaString & dialog) const; - virtual void grantAllRewardsWthMessage(const CGHeroInstance * contextHero, const std::vector& rewardIndices, bool markAsVisit) const; + virtual void grantAllRewardsWithMessage(const CGHeroInstance * contextHero, const std::vector& rewardIndices, bool markAsVisit) const; std::vector loadComponents(const CGHeroInstance * contextHero, const std::vector & rewardIndices) const; diff --git a/lib/mapObjects/MiscObjects.cpp b/lib/mapObjects/MiscObjects.cpp index 21b0cd0d9..a7cef0720 100644 --- a/lib/mapObjects/MiscObjects.cpp +++ b/lib/mapObjects/MiscObjects.cpp @@ -375,7 +375,7 @@ bool CGTeleport::isChannelExit(const ObjectInstanceID & id) const std::vector CGTeleport::getAllEntrances(bool excludeCurrent) const { - auto ret = cb->getTeleportChannelEntraces(channel); + auto ret = cb->getTeleportChannelEntrances(channel); if(excludeCurrent) vstd::erase_if_present(ret, id); diff --git a/lib/mapObjects/ObstacleSetHandler.h b/lib/mapObjects/ObstacleSetHandler.h index 004a96279..349175175 100644 --- a/lib/mapObjects/ObstacleSetHandler.h +++ b/lib/mapObjects/ObstacleSetHandler.h @@ -29,7 +29,7 @@ public: INVALID = -1, MOUNTAINS = 0, TREES, - LAKES, // Inluding dry or lava lakes + LAKES, // Including dry or lava lakes CRATERS, // Chasms, Canyons, etc. ROCKS, PLANTS, // Flowers, cacti, mushrooms, logs, shrubs, etc. diff --git a/lib/mapping/CMap.cpp b/lib/mapping/CMap.cpp index 5c0fe16bc..ad2bf657a 100644 --- a/lib/mapping/CMap.cpp +++ b/lib/mapping/CMap.cpp @@ -46,20 +46,20 @@ CMapEvent::CMapEvent() : players(0) , humanAffected(false) , computerAffected(false) - , firstOccurence(0) - , nextOccurence(0) + , firstOccurrence(0) + , nextOccurrence(0) { } bool CMapEvent::earlierThan(const CMapEvent & other) const { - return firstOccurence < other.firstOccurence; + return firstOccurrence < other.firstOccurrence; } bool CMapEvent::earlierThanOrEqual(const CMapEvent & other) const { - return firstOccurence <= other.firstOccurence; + return firstOccurrence <= other.firstOccurrence; } void CMapEvent::serializeJson(JsonSerializeFormat & handler) @@ -69,8 +69,8 @@ void CMapEvent::serializeJson(JsonSerializeFormat & handler) handler.serializeInt("players", players); handler.serializeInt("humanAffected", humanAffected); handler.serializeInt("computerAffected", computerAffected); - handler.serializeInt("firstOccurence", firstOccurence); - handler.serializeInt("nextOccurence", nextOccurence); + handler.serializeInt("firstOccurrence", firstOccurrence); + handler.serializeInt("nextOccurrence", nextOccurrence); resources.serializeJson(handler, "resources"); } @@ -571,7 +571,7 @@ void CMap::removeObject(CGObjectInstance * obj) removeBlockVisTiles(obj); instanceNames.erase(obj->instanceName); - //update indeces + //update indices auto iter = std::next(objects.begin(), obj->id.getNum()); iter = objects.erase(iter); @@ -582,7 +582,7 @@ void CMap::removeObject(CGObjectInstance * obj) obj->afterRemoveFromMap(this); - //TOOD: Clean artifact instances (mostly worn by hero?) and quests related to this object + //TODO: Clean artifact instances (mostly worn by hero?) and quests related to this object //This causes crash with undo/redo in editor } diff --git a/lib/mapping/CMapDefines.h b/lib/mapping/CMapDefines.h index e1032aff7..6f5e2ce47 100644 --- a/lib/mapping/CMapDefines.h +++ b/lib/mapping/CMapDefines.h @@ -39,8 +39,8 @@ public: ui8 players; // affected players, bit field? bool humanAffected; bool computerAffected; - ui32 firstOccurence; - ui32 nextOccurence; /// specifies after how many days the event will occur the next time; 0 if event occurs only one time + ui32 firstOccurrence; + ui32 nextOccurrence; /// specifies after how many days the event will occur the next time; 0 if event occurs only one time template void serialize(Handler & h) @@ -51,8 +51,8 @@ public: h & players; h & humanAffected; h & computerAffected; - h & firstOccurence; - h & nextOccurence; + h & firstOccurrence; + h & nextOccurrence; } virtual void serializeJson(JsonSerializeFormat & handler); diff --git a/lib/mapping/CMapHeader.cpp b/lib/mapping/CMapHeader.cpp index 74ec81358..4041d441c 100644 --- a/lib/mapping/CMapHeader.cpp +++ b/lib/mapping/CMapHeader.cpp @@ -163,7 +163,7 @@ void CMapHeader::registerMapStrings() std::string baseLanguage; std::string language; - //english is preferrable as base language + //english is preferable as base language if(mapBaseLanguages.count(Languages::getLanguageOptions(Languages::ELanguages::ENGLISH).identifier)) baseLanguage = Languages::getLanguageOptions(Languages::ELanguages::ENGLISH).identifier; else diff --git a/lib/mapping/CMapHeader.h b/lib/mapping/CMapHeader.h index 433d91c02..d0992b6f2 100644 --- a/lib/mapping/CMapHeader.h +++ b/lib/mapping/CMapHeader.h @@ -242,7 +242,7 @@ public: std::vector players; /// The default size of the vector is PlayerColor::PLAYER_LIMIT. ui8 howManyTeams; std::set allowedHeroes; - std::set reservedCampaignHeroes; /// Heroes that have placeholders in this map and are reserverd for campaign + std::set reservedCampaignHeroes; /// Heroes that have placeholders in this map and are reserved for campaign bool areAnyPlayers; /// Unused. True if there are any playable players on the map. @@ -267,7 +267,7 @@ public: h & height; h & twoLevel; // FIXME: we should serialize enum's according to their underlying type - // should be fixed when we are making breaking change to save compatiblity + // should be fixed when we are making breaking change to save compatibility static_assert(Handler::Version::MINIMAL < Handler::Version::RELEASE_143); uint8_t difficultyInteger = static_cast(difficulty); h & difficultyInteger; diff --git a/lib/mapping/MapFeaturesH3M.cpp b/lib/mapping/MapFeaturesH3M.cpp index 99bda2b09..6b93a39f3 100644 --- a/lib/mapping/MapFeaturesH3M.cpp +++ b/lib/mapping/MapFeaturesH3M.cpp @@ -118,7 +118,7 @@ MapFormatFeaturesH3M MapFormatFeaturesH3M::getFeaturesWOG() MapFormatFeaturesH3M MapFormatFeaturesH3M::getFeaturesHOTA(uint32_t hotaVersion) { // even if changes are minimal, we might not be able to parse map header in map selection screen - // throw exception - to be catched by map selection screen & excluded as invalid + // throw exception - to be caught by map selection screen & excluded as invalid if(hotaVersion > 3) throw std::runtime_error("Invalid map format!"); diff --git a/lib/mapping/MapFormatH3M.cpp b/lib/mapping/MapFormatH3M.cpp index dcbf09371..c9dab731e 100644 --- a/lib/mapping/MapFormatH3M.cpp +++ b/lib/mapping/MapFormatH3M.cpp @@ -1052,7 +1052,7 @@ void CMapLoaderH3M::readBoxContent(CGPandoraBox * object, const int3 & mapPositi if(auto val = reader->readInt8Checked(-3, 3)) reward.bonuses.emplace_back(BonusDuration::ONE_BATTLE, BonusType::LUCK, BonusSource::OBJECT_INSTANCE, val, BonusSourceID(idToBeGiven)); - reader->readResourses(reward.resources); + reader->readResources(reward.resources); for(int x = 0; x < GameConstants::PRIMARY_SKILLS; ++x) reward.primary.at(x) = reader->readUInt8(); @@ -1109,7 +1109,7 @@ CGObjectInstance * CMapLoaderH3M::readMonster(const int3 & mapPosition, const Ob if(hasMessage) { object->message.appendTextID(readLocalizedString(TextIdentifier("monster", mapPosition.x, mapPosition.y, mapPosition.z, "message"))); - reader->readResourses(object->resources); + reader->readResources(object->resources); object->gainedArtifact = reader->readArtifact(); } object->neverFlees = reader->readBool(); @@ -1119,18 +1119,18 @@ CGObjectInstance * CMapLoaderH3M::readMonster(const int3 & mapPosition, const Ob if(features.levelHOTA3) { //TODO: HotA - int32_t agressionExact = reader->readInt32(); // -1 = default, 1-10 = possible values range + int32_t aggressionExact = reader->readInt32(); // -1 = default, 1-10 = possible values range bool joinOnlyForMoney = reader->readBool(); // if true, monsters will only join for money - int32_t joinPercent = reader->readInt32(); // 100 = default, percent of monsters that will join on succesfull agression check + int32_t joinPercent = reader->readInt32(); // 100 = default, percent of monsters that will join on successful aggression check int32_t upgradedStack = reader->readInt32(); // Presence of upgraded stack, -1 = random, 0 = never, 1 = always int32_t stacksCount = reader->readInt32(); // TODO: check possible values. How many creature stacks will be present on battlefield, -1 = default - if(agressionExact != -1 || joinOnlyForMoney || joinPercent != 100 || upgradedStack != -1 || stacksCount != -1) + if(aggressionExact != -1 || joinOnlyForMoney || joinPercent != 100 || upgradedStack != -1 || stacksCount != -1) logGlobal->warn( "Map '%s': Wandering monsters %s settings %d %d %d %d %d are not implemented!", mapName, mapPosition.toString(), - agressionExact, + aggressionExact, int(joinOnlyForMoney), joinPercent, upgradedStack, @@ -2238,7 +2238,7 @@ CGObjectInstance * CMapLoaderH3M::readTown(const int3 & position, std::shared_pt event.name = readBasicString(); event.message.appendTextID(readLocalizedString(TextIdentifier("town", position.x, position.y, position.z, "event", eventID, "description"))); - reader->readResourses(event.resources); + reader->readResources(event.resources); event.players = reader->readUInt8(); if(features.levelSOD) @@ -2247,8 +2247,8 @@ CGObjectInstance * CMapLoaderH3M::readTown(const int3 & position, std::shared_pt event.humanAffected = true; event.computerAffected = reader->readBool(); - event.firstOccurence = reader->readUInt16(); - event.nextOccurence = reader->readUInt8(); + event.firstOccurrence = reader->readUInt16(); + event.nextOccurrence = reader->readUInt8(); reader->skipZero(17); @@ -2276,7 +2276,7 @@ CGObjectInstance * CMapLoaderH3M::readTown(const int3 & position, std::shared_pt if (mapHeader->players[alignment].canAnyonePlay()) object->alignmentToPlayer = PlayerColor(alignment); else - logGlobal->warn("%s - Aligment of town at %s is invalid! Player %d is not present on map!", mapName, position.toString(), int(alignment)); + logGlobal->warn("%s - Alignment of town at %s is invalid! Player %d is not present on map!", mapName, position.toString(), int(alignment)); } else { @@ -2285,11 +2285,11 @@ CGObjectInstance * CMapLoaderH3M::readTown(const int3 & position, std::shared_pt if(invertedAlignment < PlayerColor::PLAYER_LIMIT.getNum()) { - logGlobal->warn("%s - Aligment of town at %s 'not as player %d' is not implemented!", mapName, position.toString(), alignment - PlayerColor::PLAYER_LIMIT.getNum()); + logGlobal->warn("%s - Alignment of town at %s 'not as player %d' is not implemented!", mapName, position.toString(), alignment - PlayerColor::PLAYER_LIMIT.getNum()); } else { - logGlobal->warn("%s - Aligment of town at %s is corrupted!!", mapName, position.toString()); + logGlobal->warn("%s - Alignment of town at %s is corrupted!!", mapName, position.toString()); } } } @@ -2308,7 +2308,7 @@ void CMapLoaderH3M::readEvents() event.name = readBasicString(); event.message.appendTextID(readLocalizedString(TextIdentifier("event", eventID, "description"))); - reader->readResourses(event.resources); + reader->readResources(event.resources); event.players = reader->readUInt8(); if(features.levelSOD) { @@ -2319,8 +2319,8 @@ void CMapLoaderH3M::readEvents() event.humanAffected = true; } event.computerAffected = reader->readBool(); - event.firstOccurence = reader->readUInt16(); - event.nextOccurence = reader->readUInt8(); + event.firstOccurrence = reader->readUInt16(); + event.nextOccurrence = reader->readUInt8(); reader->skipZero(17); diff --git a/lib/mapping/MapReaderH3M.cpp b/lib/mapping/MapReaderH3M.cpp index d2db92dff..a2fec4e04 100644 --- a/lib/mapping/MapReaderH3M.cpp +++ b/lib/mapping/MapReaderH3M.cpp @@ -393,7 +393,7 @@ void MapReaderH3M::skipZero(size_t amount) #endif } -void MapReaderH3M::readResourses(TResources & resources) +void MapReaderH3M::readResources(TResources & resources) { for(int x = 0; x < features.resourcesCount; ++x) resources[x] = reader->readInt32(); diff --git a/lib/mapping/MapReaderH3M.h b/lib/mapping/MapReaderH3M.h index 42b446ba5..d6312a80d 100644 --- a/lib/mapping/MapReaderH3M.h +++ b/lib/mapping/MapReaderH3M.h @@ -67,7 +67,7 @@ public: void skipUnused(size_t amount); void skipZero(size_t amount); - void readResourses(TResources & resources); + void readResources(TResources & resources); bool readBool(); diff --git a/lib/minizip/MiniZip64_Changes.txt b/lib/minizip/MiniZip64_Changes.txt index 13a1bd91a..375946811 100644 --- a/lib/minizip/MiniZip64_Changes.txt +++ b/lib/minizip/MiniZip64_Changes.txt @@ -1,5 +1,5 @@ -MiniZip 1.1 was derrived from MiniZip at version 1.01f +MiniZip 1.1 was derived from MiniZip at version 1.01f Change in 1.0 (Okt 2009) - **TODO - Add history** diff --git a/lib/minizip/ioapi.h b/lib/minizip/ioapi.h index 1bc77cfd7..401e87db7 100644 --- a/lib/minizip/ioapi.h +++ b/lib/minizip/ioapi.h @@ -90,7 +90,7 @@ #include "mz64conf.h" #endif -/* a type choosen by DEFINE */ +/* a type chosen by DEFINE */ #ifdef HAVE_64BIT_INT_CUSTOM typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; #else diff --git a/lib/minizip/miniunz.c b/lib/minizip/miniunz.c index 3d65401be..b00f18de9 100644 --- a/lib/minizip/miniunz.c +++ b/lib/minizip/miniunz.c @@ -200,7 +200,7 @@ void do_help() " -l list files\n" \ " -d directory to extract into\n" \ " -o overwrite files without prompting\n" \ - " -p extract crypted file using password\n\n"); + " -p extract encrypted file using password\n\n"); } void Display64BitsSize(ZPOS64_T n, int size_char) @@ -259,7 +259,7 @@ int do_list(uf) if (file_info.uncompressed_size>0) ratio = (uLong)((file_info.compressed_size*100)/file_info.uncompressed_size); - /* display a '*' if the file is crypted */ + /* display a '*' if the file is encrypted */ if ((file_info.flag & 1) != 0) charCrypt='*'; diff --git a/lib/minizip/unzip.c b/lib/minizip/unzip.c index f6261cbae..6ac19a574 100644 --- a/lib/minizip/unzip.c +++ b/lib/minizip/unzip.c @@ -53,8 +53,8 @@ Oct-2009 - Mathias Svensson - Fixed problem if uncompressed size was > 4G and compressed size was <4G should only read the compressed/uncompressed size from the Zip64 format if the size from normal header was 0xFFFFFFFF - Oct-2009 - Mathias Svensson - Applied some bug fixes from paches recived from Gilles Vollant - Oct-2009 - Mathias Svensson - Applied support to unzip files with compression mathod BZIP2 (bzip2 lib is required) + Oct-2009 - Mathias Svensson - Applied some bug fixes from patches received from Gilles Vollant + Oct-2009 - Mathias Svensson - Applied support to unzip files with compression method BZIP2 (bzip2 lib is required) Patch created by Daniel Borca Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer @@ -153,7 +153,7 @@ typedef struct ZPOS64_T rest_read_compressed; /* number of byte to be decompressed */ ZPOS64_T rest_read_uncompressed;/*number of byte to be obtained after decomp*/ zlib_filefunc64_32_def z_filefunc; - voidpf filestream; /* io structore of the zipfile */ + voidpf filestream; /* io structure of the zipfile */ uLong compression_method; /* compression method (0==store) */ ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ int raw; @@ -166,7 +166,7 @@ typedef struct { zlib_filefunc64_32_def z_filefunc; int is64bitOpenFunction; - voidpf filestream; /* io structore of the zipfile */ + voidpf filestream; /* io structure of the zipfile */ unz_global_info64 gi; /* public global information */ ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ ZPOS64_T num_file; /* number of the current file in the zipfile*/ @@ -200,7 +200,7 @@ typedef struct /* =========================================================================== Read a byte from a gz_stream; update next_in and avail_in. Return EOF for end of file. - IN assertion: the stream s has been sucessfully opened for reading. + IN assertion: the stream s has been successfully opened for reading. */ @@ -380,10 +380,10 @@ local int strcmpcasenosensitive_internal (const char* fileName1, const char* fil /* Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + If iCaseSenisivity = 1, comparison is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparison is not case sensitivity (like strcmpi or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + If iCaseSenisivity = 0, case sensitivity is default of your operating system (like 1 on Unix, 2 on Windows) */ @@ -591,9 +591,9 @@ local unzFile unzOpenInternal (const void *path, uLong uL; uLong number_disk; /* number of the current dist, used for - spaning ZIP, unsupported, always 0*/ + spanning ZIP, unsupported, always 0*/ uLong number_disk_with_CD; /* number the the disk with central dir, used - for spaning ZIP, unsupported, always 0*/ + for spanning ZIP, unsupported, always 0*/ ZPOS64_T number_entry_CD; /* total number of entries in the central dir (same than number_entry on nospan) */ @@ -847,7 +847,7 @@ extern int MINIZIP_EXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglob return UNZ_OK; } /* - Translate date/time from Dos format to tm_unz (readable more easilty) + Translate date/time from Dos format to tm_unz (readable more easily) */ local void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz* ptm) { diff --git a/lib/minizip/unzip.h b/lib/minizip/unzip.h index 52bcc7ed5..b38561465 100644 --- a/lib/minizip/unzip.h +++ b/lib/minizip/unzip.h @@ -155,10 +155,10 @@ extern int MINIZIP_EXPORT unzStringFileNameCompare OF ((const char* fileName1, int iCaseSensitivity)); /* Compare two filename (fileName1,fileName2). - If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) - If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + If iCaseSenisivity = 1, comparison is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparison is not case sensitivity (like strcmpi or strcasecmp) - If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + If iCaseSenisivity = 0, case sensitivity is default of your operating system (like 1 on Unix, 2 on Windows) */ diff --git a/lib/minizip/zip.c b/lib/minizip/zip.c index 93886fcac..1244d8f13 100644 --- a/lib/minizip/zip.c +++ b/lib/minizip/zip.c @@ -14,8 +14,8 @@ Oct-2009 - Mathias Svensson - Added Zip64 Support when creating new file archives Oct-2009 - Mathias Svensson - Did some code cleanup and refactoring to get better overview of some functions. Oct-2009 - Mathias Svensson - Added zipRemoveExtraInfoBlock to strip extra field data from its ZIP64 data - It is used when recreting zip archive with RAW when deleting items from a zip. - ZIP64 data is automaticly added to items that needs it, and existing ZIP64 data need to be removed. + It is used when recreating zip archive with RAW when deleting items from a zip. + ZIP64 data is automatically added to items that needs it, and existing ZIP64 data need to be removed. Oct-2009 - Mathias Svensson - Added support for BZIP2 as compression mode (bzip2 lib is required) Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer @@ -52,7 +52,7 @@ /* compile with -Dlocal if your debugger can't find static symbols */ #ifndef VERSIONMADEBY -# define VERSIONMADEBY (0x0) /* platform depedent */ +# define VERSIONMADEBY (0x0) /* platform dependent */ #endif #ifndef Z_BUFSIZE @@ -121,7 +121,7 @@ typedef struct linkedlist_datablock_internal_s struct linkedlist_datablock_internal_s* next_datablock; uLong avail_in_this_block; uLong filled_in_this_block; - uLong unused; /* for future use and alignement */ + uLong unused; /* for future use and alignment */ unsigned char data[SIZEDATA_INDATABLOCK]; } linkedlist_datablock_internal; @@ -143,20 +143,20 @@ typedef struct uInt pos_in_buffered_data; /* last written byte in buffered_data */ ZPOS64_T pos_local_header; /* offset of the local header of the file - currenty writing */ + currently writing */ char* central_header; /* central header data for the current file */ uLong size_centralExtra; uLong size_centralheader; /* size of the central header for cur file */ uLong size_centralExtraFree; /* Extra bytes allocated to the centralheader but that are not used */ uLong flag; /* flag of the file currently writing */ - int method; /* compression method of file currenty wr.*/ + int method; /* compression method of file currently wr.*/ int raw; /* 1 for directly writing raw data */ Byte buffered_data[Z_BUFSIZE];/* buffer contain compressed data to be writ*/ uLong dosDate; uLong crc32; int encrypt; - int zip64; /* Add ZIP64 extened information in the extra field */ + int zip64; /* Add ZIP64 extended information in the extra field */ ZPOS64_T pos_zip64extrainfo; ZPOS64_T totalCompressedData; ZPOS64_T totalUncompressedData; @@ -170,13 +170,13 @@ typedef struct typedef struct { zlib_filefunc64_32_def z_filefunc; - voidpf filestream; /* io structore of the zipfile */ + voidpf filestream; /* io structure of the zipfile */ linkedlist_data central_dir;/* datablock with central dir in construction*/ int in_opened_file_inzip; /* 1 if a file in the zip is currently writ.*/ - curfile64_info ci; /* info on the file curretly writing */ + curfile64_info ci; /* info on the file currently writing */ ZPOS64_T begin_pos; /* position of the beginning of the zipfile */ - ZPOS64_T add_position_when_writting_offset; + ZPOS64_T add_position_when_writing_offset; ZPOS64_T number_entry; #ifndef NO_ADDFILEINEXISTINGZIP @@ -653,9 +653,9 @@ int LoadCentralDirectoryRecord(zip64_internal* pziinit) uLong uL; uLong number_disk; /* number of the current dist, used for - spaning ZIP, unsupported, always 0*/ + spanning ZIP, unsupported, always 0*/ uLong number_disk_with_CD; /* number the the disk with central dir, used - for spaning ZIP, unsupported, always 0*/ + for spanning ZIP, unsupported, always 0*/ ZPOS64_T number_entry; ZPOS64_T number_entry_CD; /* total number of entries in the central dir @@ -812,7 +812,7 @@ int LoadCentralDirectoryRecord(zip64_internal* pziinit) } byte_before_the_zipfile = central_pos - (offset_central_dir+size_central_dir); - pziinit->add_position_when_writting_offset = byte_before_the_zipfile; + pziinit->add_position_when_writing_offset = byte_before_the_zipfile; { ZPOS64_T size_central_dir_to_read = size_central_dir; @@ -880,7 +880,7 @@ extern zipFile MINIZIP_EXPORT zipOpen3 (const void *pathname, int append, zipcha ziinit.in_opened_file_inzip = 0; ziinit.ci.stream_initialised = 0; ziinit.number_entry = 0; - ziinit.add_position_when_writting_offset = 0; + ziinit.add_position_when_writing_offset = 0; init_linkedlist(&(ziinit.central_dir)); @@ -1169,7 +1169,7 @@ extern int MINIZIP_EXPORT zipOpenNewFileInZip4_64 (zipFile file, const char* fil if(zi->ci.pos_local_header >= 0xffffffff) zip64local_putValue_inmemory(zi->ci.central_header+42,(uLong)0xffffffff,4); else - zip64local_putValue_inmemory(zi->ci.central_header+42,(uLong)zi->ci.pos_local_header - zi->add_position_when_writting_offset,4); + zip64local_putValue_inmemory(zi->ci.central_header+42,(uLong)zi->ci.pos_local_header - zi->add_position_when_writing_offset,4); for (i=0;ici.central_header+SIZECENTRALHEADER+i) = *(filename+i); @@ -1760,7 +1760,7 @@ extern int MINIZIP_EXPORT zipCloseFileInZip (zipFile file) int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip) { int err = ZIP_OK; - ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writting_offset; + ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writing_offset; err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDLOCHEADERMAGIC,4); @@ -1813,7 +1813,7 @@ int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centra if (err==ZIP_OK) /* offset of start of central directory with respect to the starting disk number */ { - ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writting_offset; + ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writing_offset; err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (ZPOS64_T)pos,8); } return err; @@ -1854,13 +1854,13 @@ int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, if (err==ZIP_OK) /* offset of start of central directory with respect to the starting disk number */ { - ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writting_offset; + ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writing_offset; if(pos >= 0xffffffff) { err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)0xffffffff,4); } else - err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)(centraldir_pos_inzip - zi->add_position_when_writting_offset),4); + err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (uLong)(centraldir_pos_inzip - zi->add_position_when_writing_offset),4); } return err; @@ -1926,7 +1926,7 @@ extern int MINIZIP_EXPORT zipClose (zipFile file, const char* global_comment) } free_linkedlist(&(zi->central_dir)); - pos = centraldir_pos_inzip - zi->add_position_when_writting_offset; + pos = centraldir_pos_inzip - zi->add_position_when_writing_offset; if(pos >= 0xffffffff || zi->number_entry > 0xFFFF) { ZPOS64_T Zip64EOCDpos = ZTELL64(zi->z_filefunc,zi->filestream); diff --git a/lib/minizip/zip.h b/lib/minizip/zip.h index a7919c9e8..1784f1ac7 100644 --- a/lib/minizip/zip.h +++ b/lib/minizip/zip.h @@ -131,7 +131,7 @@ extern zipFile MINIZIP_EXPORT zipOpen64 OF((const void *pathname, int append)); /* Note : there is no delete function into a zipfile. If you want delete file into a zipfile, you must open a zipfile, and create another - Of couse, you can use RAW reading and writing to copy the file you did not want delte + Of couse, you can use RAW reading and writing to copy the file you did not want delete */ extern zipFile MINIZIP_EXPORT zipOpen2 OF((const char *pathname, diff --git a/lib/modding/CModHandler.cpp b/lib/modding/CModHandler.cpp index cec069713..3dc775352 100644 --- a/lib/modding/CModHandler.cpp +++ b/lib/modding/CModHandler.cpp @@ -120,7 +120,7 @@ std::vector CModHandler::validateAndSortDependencies(std::vector getAllMods() const; std::vector getActiveMods() const; - /// Returns human-readable string that describes erros encounter during mod loading, such as missing dependencies + /// Returns human-readable string that describes errors encounter during mod loading, such as missing dependencies std::string getModLoadErrors() const; const CModInfo & getModInfo(const TModID & modId) const; diff --git a/lib/modding/IdentifierStorage.cpp b/lib/modding/IdentifierStorage.cpp index 09b0eed98..417a284c8 100644 --- a/lib/modding/IdentifierStorage.cpp +++ b/lib/modding/IdentifierStorage.cpp @@ -430,7 +430,7 @@ bool CIdentifierStorage::resolveIdentifier(const ObjectCallback & request) const return true; } - if (request.optional && identifiers.empty()) // failed to resolve optinal ID + if (request.optional && identifiers.empty()) // failed to resolve optional ID { return true; } diff --git a/lib/networkPacks/NetPacksLib.cpp b/lib/networkPacks/NetPacksLib.cpp index cfbe01124..2f8813a1a 100644 --- a/lib/networkPacks/NetPacksLib.cpp +++ b/lib/networkPacks/NetPacksLib.cpp @@ -1348,7 +1348,7 @@ void NewStructures::applyGs(CGameState *gs) t->deleteTownBonus(overrideBid); } } - t->builded = builded; + t->built = built; t->recreateBuildingsBonuses(); } @@ -1668,7 +1668,7 @@ void RebalanceStacks::applyGs(CGameState * gs) { dstArt->move(*dstStack, ArtifactPosition::CREATURE_SLOT, *srcHero, dstSlot); } - //else - artifact cna be lost :/ + //else - artifact can be lost :/ else { EraseArtifact ea; @@ -1998,7 +1998,7 @@ void NewTurn::applyGs(CGameState *gs) creatureSet.second.applyGs(gs); for(CGTownInstance* t : gs->map->towns) - t->builded = 0; + t->built = 0; if(gs->getDate(Date::DAY_OF_WEEK) == 1) gs->updateRumor(); diff --git a/lib/networkPacks/PacksForClient.h b/lib/networkPacks/PacksForClient.h index 866c8a9d3..1b70d720a 100644 --- a/lib/networkPacks/PacksForClient.h +++ b/lib/networkPacks/PacksForClient.h @@ -660,7 +660,7 @@ struct DLL_LINKAGE NewStructures : public CPackForClient ObjectInstanceID tid; std::set bid; - si16 builded = 0; + si16 built = 0; void visitTyped(ICPackVisitor & visitor) override; @@ -668,7 +668,7 @@ struct DLL_LINKAGE NewStructures : public CPackForClient { h & tid; h & bid; - h & builded; + h & built; } }; diff --git a/lib/pathfinder/CPathfinder.cpp b/lib/pathfinder/CPathfinder.cpp index a2c5f6e7b..f2e56e625 100644 --- a/lib/pathfinder/CPathfinder.cpp +++ b/lib/pathfinder/CPathfinder.cpp @@ -103,7 +103,7 @@ CGPathNode * CPathfinder::topAndPop() void CPathfinder::calculatePaths() { - //logGlobal->info("Calculating paths for hero %s (adress %d) of player %d", hero->name, hero , hero->tempOwner); + //logGlobal->info("Calculating paths for hero %s (address %d) of player %d", hero->name, hero , hero->tempOwner); //initial tile - set cost on 0 and add to the queue std::vector initialNodes = config->nodeStorage->getInitialNodes(); @@ -175,7 +175,7 @@ void CPathfinder::calculatePaths() if(!hlp->isPatrolMovementAllowed(neighbour->coord)) continue; - /// Check transition without tile accessability rules + /// Check transition without tile accessibility rules if(source.node->layer != neighbour->layer && !isLayerTransitionPossible()) continue; diff --git a/lib/rewardable/Configuration.h b/lib/rewardable/Configuration.h index 9880ea547..45038b8a2 100644 --- a/lib/rewardable/Configuration.h +++ b/lib/rewardable/Configuration.h @@ -35,7 +35,7 @@ enum ESelectMode { SELECT_FIRST, // first reward that matches limiters SELECT_PLAYER, // player can select from all allowed rewards - SELECT_RANDOM, // one random reward from all mathing limiters + SELECT_RANDOM, // one random reward from all matching limiters SELECT_ALL // grant all rewards that match limiters }; @@ -143,7 +143,7 @@ struct DLL_LINKAGE Configuration /// how reward will be selected, uses ESelectMode enum ui8 selectMode = Rewardable::SELECT_FIRST; - /// contols who can visit an object, uses EVisitMode enum + /// controls who can visit an object, uses EVisitMode enum ui8 visitMode = Rewardable::VISIT_UNLIMITED; /// how and when should the object be reset diff --git a/lib/rewardable/Interface.cpp b/lib/rewardable/Interface.cpp index eab619288..d9a640d29 100644 --- a/lib/rewardable/Interface.cpp +++ b/lib/rewardable/Interface.cpp @@ -195,7 +195,7 @@ void Rewardable::Interface::grantRewardAfterLevelup(IGameCallback * cb, const Re for(const auto & crea : info.reward.creatures) creatures.addToSlot(creatures.getFreeSlot(), new CStackInstance(crea.type, crea.count)); - if(auto * army = dynamic_cast(this)) //TODO: to fix that, CArmedInstance must be splitted on map instance part and interface part + if(auto * army = dynamic_cast(this)) //TODO: to fix that, CArmedInstance must be split on map instance part and interface part cb->giveCreatures(army, hero, creatures, false); } diff --git a/lib/rmg/CMapGenerator.h b/lib/rmg/CMapGenerator.h index e75d9fe3a..e500016fa 100644 --- a/lib/rmg/CMapGenerator.h +++ b/lib/rmg/CMapGenerator.h @@ -67,7 +67,7 @@ public: std::unique_ptr generate(); int getNextMonlithIndex(); - int getPrisonsRemaning() const; + int getPrisonsRemaining() const; std::shared_ptr getZonePlacer() const; const std::vector & getAllPossibleQuestArtifacts() const; const std::vector getAllPossibleHeroes() const; diff --git a/lib/rmg/CRmgTemplate.cpp b/lib/rmg/CRmgTemplate.cpp index 7e79f9f4d..91809a019 100644 --- a/lib/rmg/CRmgTemplate.cpp +++ b/lib/rmg/CRmgTemplate.cpp @@ -761,7 +761,7 @@ std::set CRmgTemplate::inheritTerrainType(std::shared_ptrgetTerrainTypeLikeZone()); zone->setTerrainTypes(inheritTerrainType(otherZone, iteration)); } - //This implicitely excludes banned terrains + //This implicitly excludes banned terrains return zone->getTerrainTypes(); } diff --git a/lib/rmg/CZonePlacer.cpp b/lib/rmg/CZonePlacer.cpp index 0e3830b6e..e2af8582a 100644 --- a/lib/rmg/CZonePlacer.cpp +++ b/lib/rmg/CZonePlacer.cpp @@ -694,7 +694,7 @@ void CZonePlacer::moveOneZone(TZoneMap& zones, TForceVector& totalForces, TDista boost::sort(misplacedZones, [](const Misplacement& lhs, Misplacement& rhs) { - return lhs.first > rhs.first; //Largest dispalcement first + return lhs.first > rhs.first; //Largest displacement first }); #ifdef ZONE_PLACEMENT_LOG @@ -974,7 +974,7 @@ void CZonePlacer::assignZones(CRandomGenerator * rand) { moveZoneToCenterOfMass(zone.second); - //TODO: similiar for islands + //TODO: similar for islands #define CREATE_FULL_UNDERGROUND true //consider linking this with water amount if (zone.second->isUnderground()) { diff --git a/lib/rmg/CZonePlacer.h b/lib/rmg/CZonePlacer.h index 2eaf429ce..414f79b3c 100644 --- a/lib/rmg/CZonePlacer.h +++ b/lib/rmg/CZonePlacer.h @@ -34,7 +34,7 @@ public: explicit CZonePlacer(RmgMap & map); int3 cords(const float3 & f) const; float metric (const int3 &a, const int3 &b) const; - float getDistance(float distance) const; //additional scaling without 0 divison + float getDistance(float distance) const; //additional scaling without 0 division ~CZonePlacer() = default; void placeZones(CRandomGenerator * rand); @@ -54,7 +54,7 @@ private: private: int width; int height; - //metric coeficient + //metric coefficient float mapSize; float gravityConstant; diff --git a/lib/rmg/RmgArea.h b/lib/rmg/RmgArea.h index 8b842900e..3c24160bc 100644 --- a/lib/rmg/RmgArea.h +++ b/lib/rmg/RmgArea.h @@ -58,7 +58,7 @@ namespace rmg int3 nearest(const Area & area) const; void clear(); - void assign(const Tileset tiles); //do not use reference to allow assigment of cached data + void assign(const Tileset tiles); //do not use reference to allow assignment of cached data void add(const int3 & tile); void erase(const int3 & tile); void unite(const Area & area); diff --git a/lib/rmg/RmgObject.cpp b/lib/rmg/RmgObject.cpp index b344b268b..0d89e1b74 100644 --- a/lib/rmg/RmgObject.cpp +++ b/lib/rmg/RmgObject.cpp @@ -326,7 +326,7 @@ const rmg::Area & Object::getVisitableArea() const { for(const auto & i : dInstances) { - // FIXME: Account for bjects with multiple visitable tiles + // FIXME: Account for objects with multiple visitable tiles dVisitableCache.add(i.getVisitablePosition()); } } diff --git a/lib/rmg/TileInfo.cpp b/lib/rmg/TileInfo.cpp index e1701a3b7..5bd4d3b55 100644 --- a/lib/rmg/TileInfo.cpp +++ b/lib/rmg/TileInfo.cpp @@ -26,7 +26,7 @@ float TileInfo::getNearestObjectDistance() const void TileInfo::setNearestObjectDistance(float value) { - nearestObjectDistance = std::max(0, value); //never negative (or unitialized) + nearestObjectDistance = std::max(0, value); //never negative (or uninitialized) } bool TileInfo::shouldBeBlocked() const { diff --git a/lib/rmg/Zone.cpp b/lib/rmg/Zone.cpp index 2bf28cae6..5bc88a8d7 100644 --- a/lib/rmg/Zone.cpp +++ b/lib/rmg/Zone.cpp @@ -269,7 +269,7 @@ void Zone::fractalize() { if (treasureValue > 250) { - // A quater at max density - means more free space + // A quarter at max density - means more free space marginFactor = (0.6f + ((std::max(0, (600 - treasureValue))) / (600.f - 250)) * 0.4f); // Low value - dense obstacles diff --git a/lib/rmg/Zone.h b/lib/rmg/Zone.h index 50fd789c2..73a985363 100644 --- a/lib/rmg/Zone.h +++ b/lib/rmg/Zone.h @@ -142,7 +142,7 @@ protected: //placement info int3 pos; float3 center; - rmg::Area dArea; //irregular area assined to zone + rmg::Area dArea; //irregular area assigned to zone rmg::Area dAreaPossible; rmg::Area dAreaFree; //core paths of free tiles that all other objects will be linked to rmg::Area dAreaUsed; diff --git a/lib/rmg/float3.h b/lib/rmg/float3.h index ca8775c3a..2870bcd6f 100644 --- a/lib/rmg/float3.h +++ b/lib/rmg/float3.h @@ -27,16 +27,16 @@ public: // returns float3 with coordinates increased by corresponding coordinate of given float3 float3 operator+(const float3 & i) const { return float3(x + i.x, y + i.y, z + i.z); } - // returns float3 with coordinates increased by given numer + // returns float3 with coordinates increased by given number float3 operator+(const float i) const { return float3(x + i, y + i, z + (si32)i); } // returns float3 with coordinates decreased by corresponding coordinate of given float3 float3 operator-(const float3 & i) const { return float3(x - i.x, y - i.y, z - i.z); } - // returns float3 with coordinates decreased by given numer + // returns float3 with coordinates decreased by given number float3 operator-(const float i) const { return float3(x - i, y - i, z - (si32)i); } - // returns float3 with plane coordinates decreased by given numer + // returns float3 with plane coordinates decreased by given number float3 operator*(const float i) const {return float3(x * i, y * i, z);} - // returns float3 with plane coordinates decreased by given numer + // returns float3 with plane coordinates decreased by given number float3 operator/(const float i) const {return float3(x / i, y / i, z);} // returns opposite position diff --git a/lib/rmg/modificators/ObjectDistributor.cpp b/lib/rmg/modificators/ObjectDistributor.cpp index 76a0ac0a6..df4723cd3 100644 --- a/lib/rmg/modificators/ObjectDistributor.cpp +++ b/lib/rmg/modificators/ObjectDistributor.cpp @@ -157,7 +157,7 @@ void ObjectDistributor::distributePrisons() } } - size_t allowedPrisons = prisonHeroPlacer->getPrisonsRemaning(); + size_t allowedPrisons = prisonHeroPlacer->getPrisonsRemaining(); for (int i = zones.size() - 1; i >= 0; i--) { auto zone = zones[i].second; diff --git a/lib/rmg/modificators/ObjectManager.cpp b/lib/rmg/modificators/ObjectManager.cpp index 97c1af859..c55bd60b5 100644 --- a/lib/rmg/modificators/ObjectManager.cpp +++ b/lib/rmg/modificators/ObjectManager.cpp @@ -481,7 +481,7 @@ bool ObjectManager::createRequiredObjects() [this, &rmgObject](const int3 & tile) { float dist = rmgObject.getArea().distanceSqr(zone.getPos()); - dist *= (dist > 12.f * 12.f) ? 10.f : 1.f; //tiles closer 12 are preferrable + dist *= (dist > 12.f * 12.f) ? 10.f : 1.f; //tiles closer 12 are preferable dist = 1000000.f - dist; //some big number return dist + map.getNearestObjectDistance(tile); }, guarded, false, OptimizeType::WEIGHT); diff --git a/lib/rmg/modificators/PrisonHeroPlacer.cpp b/lib/rmg/modificators/PrisonHeroPlacer.cpp index d4787784d..3aafc0eda 100644 --- a/lib/rmg/modificators/PrisonHeroPlacer.cpp +++ b/lib/rmg/modificators/PrisonHeroPlacer.cpp @@ -43,7 +43,7 @@ void PrisonHeroPlacer::getAllowedHeroes() } } -int PrisonHeroPlacer::getPrisonsRemaning() const +int PrisonHeroPlacer::getPrisonsRemaining() const { return std::max(allowedHeroes.size() - reservedHeroes, 0); } @@ -51,7 +51,7 @@ int PrisonHeroPlacer::getPrisonsRemaning() const HeroTypeID PrisonHeroPlacer::drawRandomHero() { RecursiveLock lock(externalAccessMutex); - if (getPrisonsRemaning() > 0) + if (getPrisonsRemaining() > 0) { RandomGeneratorUtil::randomShuffle(allowedHeroes, zone.getRand()); HeroTypeID ret = allowedHeroes.back(); diff --git a/lib/rmg/modificators/PrisonHeroPlacer.h b/lib/rmg/modificators/PrisonHeroPlacer.h index 62c32d381..c302daa4e 100644 --- a/lib/rmg/modificators/PrisonHeroPlacer.h +++ b/lib/rmg/modificators/PrisonHeroPlacer.h @@ -25,7 +25,7 @@ public: void process() override; void init() override; - int getPrisonsRemaning() const; + int getPrisonsRemaining() const; [[nodiscard]] HeroTypeID drawRandomHero(); void restoreDrawnHero(const HeroTypeID & hid); diff --git a/lib/rmg/modificators/TreasurePlacer.cpp b/lib/rmg/modificators/TreasurePlacer.cpp index fd44c5761..96a093f61 100644 --- a/lib/rmg/modificators/TreasurePlacer.cpp +++ b/lib/rmg/modificators/TreasurePlacer.cpp @@ -521,7 +521,7 @@ void TreasurePlacer::addAllPossibleObjects() } static const int seerLevels = std::min(generator.getConfig().questValues.size(), generator.getConfig().questRewardValues.size()); - for(int i = 0; i < seerLevels; i++) //seems that code for exp and gold reward is similiar + for(int i = 0; i < seerLevels; i++) //seems that code for exp and gold reward is similar { int randomAppearance = chooseRandomAppearance(zone.getRand(), Obj::SEER_HUT, zone.getTerrainType()); @@ -895,15 +895,15 @@ void TreasurePlacer::createTreasures(ObjectManager& manager) int value = std::accumulate(treasurePileInfos.begin(), treasurePileInfos.end(), 0, [](int v, const ObjectInfo* oi) {return v + oi->value; }); - const ui32 maxPileGenerationAttemps = 2; - for (ui32 attempt = 0; attempt < maxPileGenerationAttemps; attempt++) + const ui32 maxPileGenerationAttempts = 2; + for (ui32 attempt = 0; attempt < maxPileGenerationAttempts; attempt++) { auto rmgObject = constructTreasurePile(treasurePileInfos, attempt == maxAttempts); if (rmgObject.instances().empty()) { - // Restore once if all attemps failed - if (attempt == (maxPileGenerationAttemps - 1)) + // Restore once if all attempts failed + if (attempt == (maxPileGenerationAttempts - 1)) { restoreZoneLimits(treasurePileInfos); } diff --git a/lib/rmg/modificators/WaterAdopter.cpp b/lib/rmg/modificators/WaterAdopter.cpp index bdb985890..af3fb68bf 100644 --- a/lib/rmg/modificators/WaterAdopter.cpp +++ b/lib/rmg/modificators/WaterAdopter.cpp @@ -133,13 +133,13 @@ void WaterAdopter::createWater(EWaterContent::EWaterContent waterContent) waterArea.subtract(noWaterArea); - //start filtering of narrow places and coast atrifacts + //start filtering of narrow places and coast artifacts rmg::Area waterAdd; for(int coastId = 1; coastId <= coastIdMax; ++coastId) { for(const auto & tile : reverseDistanceMap[coastId]) { - //collect neighbout water tiles + //collect neighbour water tiles auto collectionLambda = [this](const int3 & t, std::set & outCollection) { if(waterArea.contains(t)) diff --git a/lib/serializer/ESerializationVersion.h b/lib/serializer/ESerializationVersion.h index 4c636b974..0072b0f5b 100644 --- a/lib/serializer/ESerializationVersion.h +++ b/lib/serializer/ESerializationVersion.h @@ -38,7 +38,7 @@ enum class ESerializationVersion : int32_t DESTROYED_OBJECTS, // 834 +list of objects destroyed by player CAMPAIGN_MAP_TRANSLATIONS, // 835 +campaigns include translations for its maps JSON_FLAGS, // 836 json uses new format for flags - MANA_LIMIT, // 837 change MANA_PER_KNOWLEGDE to percentage + MANA_LIMIT, // 837 change MANA_PER_KNOWLEDGE to percentage BONUS_META_STRING, // 838 bonuses use MetaString instead of std::string for descriptions TURN_TIMERS_STATE, // 839 current state of turn timers is serialized ARTIFACT_COSTUMES, // 840 swappable artifacts set added @@ -51,7 +51,7 @@ enum class ESerializationVersion : int32_t RELEASE_152 = BANK_UNIT_PLACEMENT, - COMPACT_STRING_SERIALIZATION, // 844 - optimized serialization of previoulsy encountered strings + COMPACT_STRING_SERIALIZATION, // 844 - optimized serialization of previously encountered strings COMPACT_INTEGER_SERIALIZATION, // 845 - serialize integers in forms similar to protobuf REMOVE_FOG_OF_WAR_POINTER, // 846 - fog of war is serialized as reference instead of pointer SIMPLE_TEXT_CONTAINER_SERIALIZATION, // 847 - text container is serialized using common routine instead of custom approach diff --git a/lib/spells/AdventureSpellMechanics.h b/lib/spells/AdventureSpellMechanics.h index 02f8c01aa..76438a3bc 100644 --- a/lib/spells/AdventureSpellMechanics.h +++ b/lib/spells/AdventureSpellMechanics.h @@ -21,7 +21,7 @@ enum class ESpellCastResult OK, // cast successful CANCEL, // cast failed but it is not an error, no mana has been spent PENDING, - ERROR// error occured, for example invalid request from player + ERROR// error occurred, for example invalid request from player }; class AdventureSpellMechanics : public IAdventureSpellMechanics diff --git a/lib/spells/BattleSpellMechanics.h b/lib/spells/BattleSpellMechanics.h index 29ad70a94..a910154d4 100644 --- a/lib/spells/BattleSpellMechanics.h +++ b/lib/spells/BattleSpellMechanics.h @@ -33,7 +33,7 @@ public: /// Returns false if spell can not be cast at all, e.g. due to not having any possible target on battlefield bool canBeCast(Problem & problem) const override; - /// Returns false if spell can not be cast at specifid target + /// Returns false if spell can not be cast at specified target bool canBeCastAt(const Target & target, Problem & problem) const override; // TODO: ??? (what's the difference compared to applyEffects?) diff --git a/lib/spells/effects/Clone.cpp b/lib/spells/effects/Clone.cpp index 491fe5023..86e3085d0 100644 --- a/lib/spells/effects/Clone.cpp +++ b/lib/spells/effects/Clone.cpp @@ -43,7 +43,7 @@ void Clone::apply(ServerCallback * server, const Mechanics * m, const EffectTarg if(clonedStack->getCount() < 1) continue; - auto hex = m->battle()->getAvaliableHex(clonedStack->creatureId(), m->casterSide, clonedStack->getPosition()); + auto hex = m->battle()->getAvailableHex(clonedStack->creatureId(), m->casterSide, clonedStack->getPosition()); if(!hex.isValid()) { diff --git a/lib/spells/effects/DemonSummon.cpp b/lib/spells/effects/DemonSummon.cpp index db14326d1..d55f24a57 100644 --- a/lib/spells/effects/DemonSummon.cpp +++ b/lib/spells/effects/DemonSummon.cpp @@ -65,7 +65,7 @@ void DemonSummon::apply(ServerCallback * server, const Mechanics * m, const Effe continue; } - auto hex = m->battle()->getAvaliableHex(targetStack->creatureId(), m->casterSide, targetStack->getPosition()); + auto hex = m->battle()->getAvailableHex(targetStack->creatureId(), m->casterSide, targetStack->getPosition()); if(!hex.isValid()) { diff --git a/lib/spells/effects/Dispel.cpp b/lib/spells/effects/Dispel.cpp index 8ad649f9a..c27d9b7d3 100644 --- a/lib/spells/effects/Dispel.cpp +++ b/lib/spells/effects/Dispel.cpp @@ -97,7 +97,7 @@ std::shared_ptr Dispel::getBonuses(const Mechanics * m, const b if(!sourceSpell) return false;//error - //Special case: DISRUPTING_RAY and ACID_BREATH_DEFENSE are "immune" to dispell + //Special case: DISRUPTING_RAY and ACID_BREATH_DEFENSE are "immune" to dispel //Other even PERMANENT effects can be removed (f.e. BIND) if(sourceSpell->getIndex() == SpellID::DISRUPTING_RAY || sourceSpell->getIndex() == SpellID::ACID_BREATH_DEFENSE) return false; diff --git a/lib/spells/effects/Obstacle.cpp b/lib/spells/effects/Obstacle.cpp index b9dbe3b0b..eb9fa5be7 100644 --- a/lib/spells/effects/Obstacle.cpp +++ b/lib/spells/effects/Obstacle.cpp @@ -101,11 +101,11 @@ void Obstacle::adjustAffectedHexes(std::set & hexes, const Mechanics for(auto & destination : effectTarget) { - for(const auto & trasformation : options.shape) + for(const auto & transformation : options.shape) { BattleHex hex = destination.hexValue; - for(auto direction : trasformation) + for(auto direction : transformation) hex.moveInDirection(direction, false); if(hex.isValid()) @@ -134,10 +134,10 @@ bool Obstacle::applicable(Problem & problem, const Mechanics * m, const EffectTa for(const auto & destination : target) { - for(const auto & trasformation : options.shape) + for(const auto & transformation : options.shape) { BattleHex hex = destination.hexValue; - for(auto direction : trasformation) + for(auto direction : transformation) hex.moveInDirection(direction, false); if(!isHexAvailable(m->battle(), hex, requiresClearTiles)) diff --git a/lib/spells/effects/Summon.cpp b/lib/spells/effects/Summon.cpp index dc0dfc153..eb7816a97 100644 --- a/lib/spells/effects/Summon.cpp +++ b/lib/spells/effects/Summon.cpp @@ -192,7 +192,7 @@ EffectTarget Summon::transformTarget(const Mechanics * m, const Target & aimPoin if(sameSummoned.empty() || !summonSameUnit) { - BattleHex hex = m->battle()->getAvaliableHex(creature, m->casterSide); + BattleHex hex = m->battle()->getAvailableHex(creature, m->casterSide); if(!hex.isValid()) logGlobal->error("No free space to summon creature!"); else diff --git a/lib/spells/effects/Teleport.cpp b/lib/spells/effects/Teleport.cpp index 4d29e9483..5dd2a32c7 100644 --- a/lib/spells/effects/Teleport.cpp +++ b/lib/spells/effects/Teleport.cpp @@ -61,7 +61,7 @@ bool Teleport::applicable(Problem & problem, const Mechanics * m, const EffectTa if(!targetUnit) return m->adaptProblem(ESpellCastProblem::WRONG_SPELL_TARGET, problem); - if(!targetHex.isValid() || !m->battle()->getAccesibility(targetUnit).accessible(targetHex, targetUnit)) + if(!targetHex.isValid() || !m->battle()->getAccessibility(targetUnit).accessible(targetHex, targetUnit)) return m->adaptProblem(ESpellCastProblem::WRONG_SPELL_TARGET, problem); if(m->battle()->battleGetSiegeLevel() && !(isWallPassable && isMoatPassable)) diff --git a/lobby/LobbyServer.cpp b/lobby/LobbyServer.cpp index 2a09e3d02..6ee3afba1 100644 --- a/lobby/LobbyServer.cpp +++ b/lobby/LobbyServer.cpp @@ -595,7 +595,7 @@ void LobbyServer::receiveClientLogin(const NetworkConnectionPtr & connection, co auto clientCookieStatus = database->getAccountCookieStatus(accountID, accountCookie); if(clientCookieStatus == LobbyCookieStatus::INVALID) - return sendOperationFailed(connection, "Authentification failure"); + return sendOperationFailed(connection, "Authentication failure"); database->updateAccountLoginTime(accountID); database->setAccountOnline(accountID, true); @@ -611,7 +611,7 @@ void LobbyServer::receiveClientLogin(const NetworkConnectionPtr & connection, co sendRecentChatHistory(connection, "global", language); // send active game rooms list to new account - // and update acount list to everybody else including new account + // and update account list to everybody else including new account broadcastActiveAccounts(); sendMessage(connection, prepareActiveGameRooms()); sendMatchesHistory(connection); diff --git a/mapeditor/CMakeLists.txt b/mapeditor/CMakeLists.txt index b1dc9b0e9..10fc377f6 100644 --- a/mapeditor/CMakeLists.txt +++ b/mapeditor/CMakeLists.txt @@ -28,7 +28,7 @@ set(editor_SRCS mapcontroller.cpp validator.cpp inspector/inspector.cpp - inspector/townbulidingswidget.cpp + inspector/townbuildingswidget.cpp inspector/armywidget.cpp inspector/messagewidget.cpp inspector/rewardswidget.cpp @@ -69,7 +69,7 @@ set(editor_HEADERS mapcontroller.h validator.h inspector/inspector.h - inspector/townbulidingswidget.h + inspector/townbuildingswidget.h inspector/armywidget.h inspector/messagewidget.h inspector/rewardswidget.h @@ -97,7 +97,7 @@ set(editor_FORMS playersettings.ui playerparams.ui validator.ui - inspector/townbulidingswidget.ui + inspector/townbuildingswidget.ui inspector/armywidget.ui inspector/messagewidget.ui inspector/rewardswidget.ui diff --git a/mapeditor/inspector/inspector.cpp b/mapeditor/inspector/inspector.cpp index 57174b68c..e878f06fa 100644 --- a/mapeditor/inspector/inspector.cpp +++ b/mapeditor/inspector/inspector.cpp @@ -20,7 +20,7 @@ #include "../lib/mapping/CMap.h" #include "../lib/constants/StringConstants.h" -#include "townbulidingswidget.h" +#include "townbuildingswidget.h" #include "armywidget.h" #include "messagewidget.h" #include "rewardswidget.h" @@ -464,7 +464,7 @@ void Inspector::updateProperties() return; table->setRowCount(0); //cleanup table - addProperty("Indentifier", obj); + addProperty("Identifier", obj); addProperty("ID", obj->ID.getNum()); addProperty("SubID", obj->subID); addProperty("InstanceName", obj->instanceName); diff --git a/mapeditor/inspector/townbulidingswidget.cpp b/mapeditor/inspector/townbuildingswidget.cpp similarity index 89% rename from mapeditor/inspector/townbulidingswidget.cpp rename to mapeditor/inspector/townbuildingswidget.cpp index b4f4c87d3..ea3d0b403 100644 --- a/mapeditor/inspector/townbulidingswidget.cpp +++ b/mapeditor/inspector/townbuildingswidget.cpp @@ -8,8 +8,8 @@ * */ #include "StdInc.h" -#include "townbulidingswidget.h" -#include "ui_townbulidingswidget.h" +#include "townbuildingswidget.h" +#include "ui_townbuildingswidget.h" #include "../lib/CGeneralTextHandler.h" std::string defaultBuildingIdConversion(BuildingID bId) @@ -66,10 +66,10 @@ std::string defaultBuildingIdConversion(BuildingID bId) } } -TownBulidingsWidget::TownBulidingsWidget(CGTownInstance & t, QWidget *parent) : +TownBuildingsWidget::TownBuildingsWidget(CGTownInstance & t, QWidget *parent) : town(t), QDialog(parent), - ui(new Ui::TownBulidingsWidget) + ui(new Ui::TownBuildingsWidget) { ui->setupUi(this); ui->treeView->setModel(&model); @@ -79,12 +79,12 @@ TownBulidingsWidget::TownBulidingsWidget(CGTownInstance & t, QWidget *parent) : //setAttribute(Qt::WA_DeleteOnClose); } -TownBulidingsWidget::~TownBulidingsWidget() +TownBuildingsWidget::~TownBuildingsWidget() { delete ui; } -QStandardItem * TownBulidingsWidget::addBuilding(const CTown & ctown, int bId, std::set & remaining) +QStandardItem * TownBuildingsWidget::addBuilding(const CTown & ctown, int bId, std::set & remaining) { BuildingID buildingId(bId); const CBuilding * building = ctown.buildings.at(buildingId); @@ -156,7 +156,7 @@ QStandardItem * TownBulidingsWidget::addBuilding(const CTown & ctown, int bId, s return checks.front(); } -void TownBulidingsWidget::addBuildings(const CTown & ctown) +void TownBuildingsWidget::addBuildings(const CTown & ctown) { auto buildings = ctown.getAllBuildings(); while(!buildings.empty()) @@ -168,7 +168,7 @@ void TownBulidingsWidget::addBuildings(const CTown & ctown) ui->treeView->resizeColumnToContents(2); } -std::set TownBulidingsWidget::getBuildingsFromModel(int modelColumn, Qt::CheckState checkState) +std::set TownBuildingsWidget::getBuildingsFromModel(int modelColumn, Qt::CheckState checkState) { std::set result; std::vector stack; @@ -192,22 +192,22 @@ std::set TownBulidingsWidget::getBuildingsFromModel(int modelColumn, return result; } -std::set TownBulidingsWidget::getForbiddenBuildings() +std::set TownBuildingsWidget::getForbiddenBuildings() { return getBuildingsFromModel(1, Qt::Unchecked); } -std::set TownBulidingsWidget::getBuiltBuildings() +std::set TownBuildingsWidget::getBuiltBuildings() { return getBuildingsFromModel(2, Qt::Checked); } -void TownBulidingsWidget::on_treeView_expanded(const QModelIndex &index) +void TownBuildingsWidget::on_treeView_expanded(const QModelIndex &index) { ui->treeView->resizeColumnToContents(0); } -void TownBulidingsWidget::on_treeView_collapsed(const QModelIndex &index) +void TownBuildingsWidget::on_treeView_collapsed(const QModelIndex &index) { ui->treeView->resizeColumnToContents(0); } @@ -219,12 +219,12 @@ TownBuildingsDelegate::TownBuildingsDelegate(CGTownInstance & t): town(t), QStyl QWidget * TownBuildingsDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const { - return new TownBulidingsWidget(town, parent); + return new TownBuildingsWidget(town, parent); } void TownBuildingsDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { - if(auto * ed = qobject_cast(editor)) + if(auto * ed = qobject_cast(editor)) { auto * ctown = town.town; if(!ctown) @@ -242,7 +242,7 @@ void TownBuildingsDelegate::setEditorData(QWidget *editor, const QModelIndex &in void TownBuildingsDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { - if(auto * ed = qobject_cast(editor)) + if(auto * ed = qobject_cast(editor)) { town.forbiddenBuildings = ed->getForbiddenBuildings(); town.builtBuildings = ed->getBuiltBuildings(); diff --git a/mapeditor/inspector/townbulidingswidget.h b/mapeditor/inspector/townbuildingswidget.h similarity index 88% rename from mapeditor/inspector/townbulidingswidget.h rename to mapeditor/inspector/townbuildingswidget.h index 81f441a98..90629f8be 100644 --- a/mapeditor/inspector/townbulidingswidget.h +++ b/mapeditor/inspector/townbuildingswidget.h @@ -14,20 +14,20 @@ #include "../lib/mapObjects/CGTownInstance.h" namespace Ui { -class TownBulidingsWidget; +class TownBuildingsWidget; } std::string defaultBuildingIdConversion(BuildingID bId); -class TownBulidingsWidget : public QDialog +class TownBuildingsWidget : public QDialog { Q_OBJECT QStandardItem * addBuilding(const CTown & ctown, int bId, std::set & remaining); public: - explicit TownBulidingsWidget(CGTownInstance &, QWidget *parent = nullptr); - ~TownBulidingsWidget(); + explicit TownBuildingsWidget(CGTownInstance &, QWidget *parent = nullptr); + ~TownBuildingsWidget(); void addBuildings(const CTown & ctown); std::set getForbiddenBuildings(); @@ -41,7 +41,7 @@ private slots: private: std::set getBuildingsFromModel(int modelColumn, Qt::CheckState checkState); - Ui::TownBulidingsWidget *ui; + Ui::TownBuildingsWidget *ui; CGTownInstance & town; mutable QStandardItemModel model; }; diff --git a/mapeditor/inspector/townbulidingswidget.ui b/mapeditor/inspector/townbuildingswidget.ui similarity index 93% rename from mapeditor/inspector/townbulidingswidget.ui rename to mapeditor/inspector/townbuildingswidget.ui index f9eece29d..86bbaf54e 100644 --- a/mapeditor/inspector/townbulidingswidget.ui +++ b/mapeditor/inspector/townbuildingswidget.ui @@ -1,7 +1,7 @@ - TownBulidingsWidget - + TownBuildingsWidget + Qt::NonModal diff --git a/mapeditor/maphandler.h b/mapeditor/maphandler.h index 579e5363b..3f8cb5a26 100644 --- a/mapeditor/maphandler.h +++ b/mapeditor/maphandler.h @@ -75,8 +75,8 @@ private: TFlippedAnimations riverAnimations;//[river type, rotation] TFlippedCache riverImages;//[river type, view type, rotation] - std::vector tileObjects; //informations about map tiles - std::map> tilesCache; //set of tiles beloging to object + std::vector tileObjects; //information about map tiles + std::map> tilesCache; //set of tiles belonging to object const CMap * map = nullptr; diff --git a/mapeditor/mapsettings/eventsettings.cpp b/mapeditor/mapsettings/eventsettings.cpp index a128aa6ef..9a060e50a 100644 --- a/mapeditor/mapsettings/eventsettings.cpp +++ b/mapeditor/mapsettings/eventsettings.cpp @@ -41,8 +41,8 @@ QVariant toVariant(const CMapEvent & event) result["players"] = QVariant::fromValue(event.players); result["humanAffected"] = QVariant::fromValue(event.humanAffected); result["computerAffected"] = QVariant::fromValue(event.computerAffected); - result["firstOccurence"] = QVariant::fromValue(event.firstOccurence); - result["nextOccurence"] = QVariant::fromValue(event.nextOccurence); + result["firstOccurrence"] = QVariant::fromValue(event.firstOccurrence); + result["nextOccurrence"] = QVariant::fromValue(event.nextOccurrence); result["resources"] = toVariant(event.resources); return QVariant(result); } @@ -56,8 +56,8 @@ CMapEvent eventFromVariant(CMapHeader & mapHeader, const QVariant & variant) result.players = v.value("players").toInt(); result.humanAffected = v.value("humanAffected").toInt(); result.computerAffected = v.value("computerAffected").toInt(); - result.firstOccurence = v.value("firstOccurence").toInt(); - result.nextOccurence = v.value("nextOccurence").toInt(); + result.firstOccurrence = v.value("firstOccurrence").toInt(); + result.nextOccurrence = v.value("nextOccurrence").toInt(); result.resources = resourcesFromVariant(v.value("resources")); return result; } diff --git a/mapeditor/mapsettings/timedevent.cpp b/mapeditor/mapsettings/timedevent.cpp index a0aec1c17..94389efc7 100644 --- a/mapeditor/mapsettings/timedevent.cpp +++ b/mapeditor/mapsettings/timedevent.cpp @@ -27,8 +27,8 @@ TimedEvent::TimedEvent(QListWidgetItem * t, QWidget *parent) : ui->eventMessageText->setPlainText(params.value("message").toString()); ui->eventAffectsCpu->setChecked(params.value("computerAffected").toBool()); ui->eventAffectsHuman->setChecked(params.value("humanAffected").toBool()); - ui->eventFirstOccurance->setValue(params.value("firstOccurence").toInt()); - ui->eventRepeatAfter->setValue(params.value("nextOccurence").toInt()); + ui->eventFirstOccurrence->setValue(params.value("firstOccurrence").toInt()); + ui->eventRepeatAfter->setValue(params.value("nextOccurrence").toInt()); for(int i = 0; i < PlayerColor::PLAYER_LIMIT_I; ++i) { @@ -66,8 +66,8 @@ void TimedEvent::on_TimedEvent_finished(int result) descriptor["message"] = ui->eventMessageText->toPlainText(); descriptor["humanAffected"] = QVariant::fromValue(ui->eventAffectsHuman->isChecked()); descriptor["computerAffected"] = QVariant::fromValue(ui->eventAffectsCpu->isChecked()); - descriptor["firstOccurence"] = QVariant::fromValue(ui->eventFirstOccurance->value()); - descriptor["nextOccurence"] = QVariant::fromValue(ui->eventRepeatAfter->value()); + descriptor["firstOccurrence"] = QVariant::fromValue(ui->eventFirstOccurrence->value()); + descriptor["nextOccurrence"] = QVariant::fromValue(ui->eventRepeatAfter->value()); int players = 0; for(int i = 0; i < ui->playersAffected->count(); ++i) diff --git a/mapeditor/mapsettings/timedevent.ui b/mapeditor/mapsettings/timedevent.ui index 92ac597ab..4fef09168 100644 --- a/mapeditor/mapsettings/timedevent.ui +++ b/mapeditor/mapsettings/timedevent.ui @@ -67,12 +67,12 @@ - Day of first occurance + Day of first occurrence - + diff --git a/mapeditor/mapsettings/translations.ui b/mapeditor/mapsettings/translations.ui index 41b6b8578..62c47bb3b 100644 --- a/mapeditor/mapsettings/translations.ui +++ b/mapeditor/mapsettings/translations.ui @@ -45,7 +45,7 @@ - Suppported + Supported diff --git a/mapeditor/mapsettings/victoryconditions.cpp b/mapeditor/mapsettings/victoryconditions.cpp index 9f84bc4d4..2fa58afe2 100644 --- a/mapeditor/mapsettings/victoryconditions.cpp +++ b/mapeditor/mapsettings/victoryconditions.cpp @@ -15,7 +15,7 @@ #include "../lib/constants/StringConstants.h" #include "../../lib/mapObjects/CGCreature.h" -#include "../inspector/townbulidingswidget.h" //to convert BuildingID to string +#include "../inspector/townbuildingswidget.h" //to convert BuildingID to string VictoryConditions::VictoryConditions(QWidget *parent) : AbstractSettings(parent), diff --git a/mapeditor/resourceExtractor/ResourceConverter.h b/mapeditor/resourceExtractor/ResourceConverter.h index faef5abdd..fc3daf221 100644 --- a/mapeditor/resourceExtractor/ResourceConverter.h +++ b/mapeditor/resourceExtractor/ResourceConverter.h @@ -14,7 +14,7 @@ struct ConversionOptions { bool splitDefs = false; // splits TwCrPort, CPRSMALL, FlagPort, ITPA, ITPt, Un32 and Un44 into individual PNG's bool convertPcxToPng = false; // converts single Images (found in Images folder) from .pcx to png. - bool deleteOriginals = false; // delete original files, for the ones splitted / converted. + bool deleteOriginals = false; // delete original files, for the ones split / converted. }; // Struct for holding all Resource Extractor / Converter options diff --git a/mapeditor/scenelayer.cpp b/mapeditor/scenelayer.cpp index 2bf5fd170..32713ebef 100644 --- a/mapeditor/scenelayer.cpp +++ b/mapeditor/scenelayer.cpp @@ -639,7 +639,7 @@ void MinimapLayer::update() pixmap.reset(new QPixmap(map->width, map->height)); QPainter painter(pixmap.get()); - //coordinate transfomation + //coordinate transformation for(int j = 0; j < map->height; ++j) { for(int i = 0; i < map->width; ++i) diff --git a/mapeditor/scenelayer.h b/mapeditor/scenelayer.h index fb640de22..468f29697 100644 --- a/mapeditor/scenelayer.h +++ b/mapeditor/scenelayer.h @@ -83,7 +83,7 @@ public: const std::set & selection() const; signals: - void selectionMade(bool anythingSlected); + void selectionMade(bool anythingSelected); private: std::set area; @@ -196,7 +196,7 @@ public: SelectionMode selectionMode = SelectionMode::NOTHING; signals: - void selectionMade(bool anythingSlected); + void selectionMade(bool anythingSelected); private: std::set selectedObjects; diff --git a/mapeditor/translation/chinese.ts b/mapeditor/translation/chinese.ts index 798527b45..aeca22c9c 100644 --- a/mapeditor/translation/chinese.ts +++ b/mapeditor/translation/chinese.ts @@ -1394,7 +1394,7 @@ - Day of first occurance + Day of first occurrence 首次发生天数 @@ -1429,9 +1429,9 @@ - TownBulidingsWidget + TownBuildingsWidget - + Buildings 建筑 @@ -1450,7 +1450,7 @@ - Suppported + Supported 已支持 @@ -1856,7 +1856,7 @@ - No template for parameters scecified. Random map cannot be generated. + No template for parameters specified. Random map cannot be generated. 未指定任一模版作为参数,随机地图无法生成。 diff --git a/mapeditor/translation/czech.ts b/mapeditor/translation/czech.ts index 2287bbde5..a38d318d7 100644 --- a/mapeditor/translation/czech.ts +++ b/mapeditor/translation/czech.ts @@ -717,7 +717,7 @@ Can't place object - Nelze umístit objekt + Nelze umístit object @@ -1185,7 +1185,7 @@ Remove object - Odstranit objekt + Odstranit object @@ -1394,7 +1394,7 @@ - Day of first occurance + Day of first occurrence Den prvního výskytu @@ -1429,9 +1429,9 @@ - TownBulidingsWidget + TownBuildingsWidget - + Buildings Budovy @@ -1450,7 +1450,7 @@ - Suppported + Supported Podporovaný @@ -1520,7 +1520,7 @@ Object %1 is assigned to non-playable player %2 - Objekt %1 je přiřazen nehratelnému hráči %2 + Object %1 je přiřazen nehratelnému hráči %2 @@ -1585,7 +1585,7 @@ Map contains object from mod "%1", but doesn't require it - Mapa obsahuje objekt z modifikace "%1". ale nevyžaduje ji + Mapa obsahuje object z modifikace "%1". ale nevyžaduje ji @@ -1856,7 +1856,7 @@ - No template for parameters scecified. Random map cannot be generated. + No template for parameters specified. Random map cannot be generated. Žádná šablona pro vybrané parametry. Náhodná mapa nemůže být vygenerována. diff --git a/mapeditor/translation/english.ts b/mapeditor/translation/english.ts index bf6d97f7e..5f63a1f59 100644 --- a/mapeditor/translation/english.ts +++ b/mapeditor/translation/english.ts @@ -1394,7 +1394,7 @@ - Day of first occurance + Day of first occurrence @@ -1429,9 +1429,9 @@ - TownBulidingsWidget + TownBuildingsWidget - + Buildings @@ -1450,7 +1450,7 @@ - Suppported + Supported @@ -1844,7 +1844,7 @@ - No template for parameters scecified. Random map cannot be generated. + No template for parameters specified. Random map cannot be generated. diff --git a/mapeditor/translation/french.ts b/mapeditor/translation/french.ts index 65eac6cc5..d75b0298e 100644 --- a/mapeditor/translation/french.ts +++ b/mapeditor/translation/french.ts @@ -255,7 +255,7 @@ Map Objects View - Vue des objets cartographiques + Vue des objects cartographiques @@ -425,7 +425,7 @@ Update appearance - Mettre à jour l'apparence + Mettre à jour l'appearance @@ -501,7 +501,7 @@ Lock objects on map to avoid unnecessary changes - Vérouiller les objets sur la carte pour éviter des changements non nécessaires + Vérouiller les objects sure la carte pour éviter des changements non nécessaires @@ -516,7 +516,7 @@ Unlock all objects on the map - Dévérouiller tous les objets de la carte + Dévérouiller tous les objects de la carte @@ -596,7 +596,7 @@ No objects selected - Pas d'objets sélectionnés + Pas d'objects sélectionnés @@ -606,7 +606,7 @@ Errors occurred. %1 objects were not updated - Erreur rencontrée. %1 objets n'ont pas étés mis à jour + Erreur rencontrée. %1 objects n'ont pas étés mis à jour @@ -717,7 +717,7 @@ Can't place object - Impossible de placer l'objet + Impossible de placer l'object @@ -758,7 +758,7 @@ Set required mods based on objects placed on the map. This method may cause problems if you have customized rewards, garrisons, etc from mods - Définir les mods obligatoires basés sur les objets présents sur la carte. Cette méthode peut poser des soucis si vous avez personalisé des récompenses, garnisons, etc depuis les mods + Définir les mods obligatoires basés sure les objects présents sure la carte. Cette méthode peut poser des soucis si vous avez personalisé des récompenses, garnisons, etc depuis les mods @@ -773,7 +773,7 @@ Full content mods - Mods de conteniu complet + Mods de conteniu complete @@ -1000,7 +1000,7 @@ Resources - Ressources + Resources @@ -1134,7 +1134,7 @@ Event info - Informations d'évènements + Information d'évènements @@ -1180,7 +1180,7 @@ Movement - Mouvement + Movement @@ -1191,7 +1191,7 @@ Primary skills - Compétances principales + Compétances principles @@ -1221,7 +1221,7 @@ Resources - Ressources + Resources @@ -1394,8 +1394,8 @@ - Day of first occurance - Jour de la première occurence + Day of first occurrence + Jour de la première occurrence @@ -1410,7 +1410,7 @@ Resources - Ressources + Resources @@ -1429,9 +1429,9 @@ - TownBulidingsWidget + TownBuildingsWidget - + Buildings Bâtiments @@ -1450,7 +1450,7 @@ - Suppported + Supported Supporté @@ -1500,7 +1500,7 @@ No players allowed to play this map - Aucun joueur autorisé à jouer sur cette carte + Aucun joueur autorisé à jouer sure cette carte @@ -1510,7 +1510,7 @@ No human players allowed to play this map - Aucun joueur humain n'est autorisé à jouer sur cette carte + Aucun joueur humain n'est autorisé à jouer sure cette carte @@ -1520,7 +1520,7 @@ Object %1 is assigned to non-playable player %2 - L'objet %1 est attribué au joueur non jouable %2 + L'object %1 est attribué au joueur non jouable %2 @@ -1545,7 +1545,7 @@ Hero %1 has duplicate on map - Le héros %1 a un doublon sur la carte + Le héros %1 a un doublon sure la carte @@ -1585,7 +1585,7 @@ Map contains object from mod "%1", but doesn't require it - La carte contient des objets du mod "%1", mais il n'est pas requis + La carte contient des objects du mod "%1", mais il n'est pas requis @@ -1643,7 +1643,7 @@ Accumulate resources - Accumuler des ressources + Accumuler des resources @@ -1668,7 +1668,7 @@ Kill monster - Tuer un monstre + Tuer un monster @@ -1802,7 +1802,7 @@ Normal - Normale + Normal @@ -1856,7 +1856,7 @@ - No template for parameters scecified. Random map cannot be generated. + No template for parameters specified. Random map cannot be generated. Pas de modèles pour les paramètres spécifiés. La carte aléatoire ne peut pas être générée. @@ -1880,7 +1880,7 @@ From an extracted archive, it Splits TwCrPort, CPRSMALL, FlagPort, ITPA, ITPt, Un32 and Un44 into individual PNG's. - À partir d'une archive extraite, il divise TwCrPort, CPRSMALL, FlagPort, ITPA, ITPt, Un32 et Un44 en fichiers PNG individuels. + À partir d'une archive extraite, il divise TwCrPort, CPRSMALL, FlagPort, ITPA, ITPt, Un32 et Un44 en fichiers PNG individuals. @@ -1890,7 +1890,7 @@ Delete original files, for the ones split / converted. - Supprimer les fichiers d'origine, pour ceux fractionnés/convertis. + Supprimer les fichiers d'origine, pour ceux fractionnés/converts. diff --git a/mapeditor/translation/german.ts b/mapeditor/translation/german.ts index 8b5791cd7..8edb1a428 100644 --- a/mapeditor/translation/german.ts +++ b/mapeditor/translation/german.ts @@ -325,7 +325,7 @@ Save as... - Speichern unter... + Speichern under... @@ -386,7 +386,7 @@ Map title and description - Titel und Beschreibung der Karte + Title und Beschreibung der Karte @@ -475,7 +475,7 @@ Export as... - Exportieren als... + Exportieren also... @@ -611,7 +611,7 @@ Save to image - Als Bild speichern + Also Bild speichern @@ -717,7 +717,7 @@ Can't place object - Objekt kann nicht platziert werden + Object kann nicht platziert werden @@ -758,7 +758,7 @@ Set required mods based on objects placed on the map. This method may cause problems if you have customized rewards, garrisons, etc from mods - Erforderliche Mods anhand der auf der Karte platzierten Objekte festlegen. Diese Methode kann Probleme verursachen, wenn Belohnungen, Garnisonen usw. von Mods angepasst wurden + Erforderliche Mods anhand der auf der Karte platzierten Objekte festlegen. Diese Method kann Problem verursachen, wenn Belohnungen, Garnisonen usw. von Mods angepasst wurden @@ -768,7 +768,7 @@ Set all mods having a game content as mandatory - Alle Mods, die einen Spielinhalt haben, als notwendig festlegen + Alle Mods, die einen Spielinhalt haben, also notwendig festlegen @@ -1185,7 +1185,7 @@ Remove object - Objekt entfernen + Object entfernen @@ -1394,7 +1394,7 @@ - Day of first occurance + Day of first occurrence Tag des ersten Auftretens @@ -1429,9 +1429,9 @@ - TownBulidingsWidget + TownBuildingsWidget - + Buildings Gebäude @@ -1450,7 +1450,7 @@ - Suppported + Supported Unterstützt @@ -1520,7 +1520,7 @@ Object %1 is assigned to non-playable player %2 - Objekt %1 ist dem nicht spielbaren Spieler %2 zugewiesen + Object %1 ist dem nicht spielbaren Spieler %2 zugewiesen @@ -1585,7 +1585,7 @@ Map contains object from mod "%1", but doesn't require it - Karte enthält Objekt aus Mod "%1", benötigt es aber nicht + Karte enthält Object aus Mod "%1", benötigt es aber nicht @@ -1856,7 +1856,7 @@ - No template for parameters scecified. Random map cannot be generated. + No template for parameters specified. Random map cannot be generated. Es wurde kein Template für Parameter erstellt. Zufällige Karte kann nicht generiert werden. @@ -1875,17 +1875,17 @@ Extract original H3 archives into a separate folder. - Extrahieren Sie die Original-H3-Archive in einen separaten Ordner. + Extrahieren Sie die Original-H3-Archive in einen separaten Order. From an extracted archive, it Splits TwCrPort, CPRSMALL, FlagPort, ITPA, ITPt, Un32 and Un44 into individual PNG's. - Aus einem extrahierten Archiv zerlegt es TwCrPort, CPRSMALL, FlagPort, ITPA, ITPt, Un32 und Un44 in einzelne PNGs. + Aus einem extrahierten Archive zerlegt es TwCrPort, CPRSMALL, FlagPort, ITPA, ITPt, Un32 und Un44 in einzelne ONGs. From an extracted archive, Converts single Images (found in Images folder) from .pcx to png. - Aus einem extrahierten Archiv werden einzelne Bilder (aus dem Ordner "Images") von .pcx in png konvertiert. + Aus einem extrahierten Archive werden einzelne Bilder (aus dem Order "Images") von .pcx in png konvertiert. diff --git a/mapeditor/translation/polish.ts b/mapeditor/translation/polish.ts index a15f2d15e..f68f45336 100644 --- a/mapeditor/translation/polish.ts +++ b/mapeditor/translation/polish.ts @@ -44,7 +44,7 @@ New event - Nowe zdarzenie + Now zdarzenie @@ -96,7 +96,7 @@ TextLabel - Tekst + Text @@ -768,7 +768,7 @@ Set all mods having a game content as mandatory - Ustaw wszystkie modyfikacje mające nowe elementy gry jako obowiązkowe + Ustaw wszystkie modyfikacje mające now elementary gry jako obowiązkowe @@ -1094,7 +1094,7 @@ On select text - Tekst wyboru + Text wyboru @@ -1394,7 +1394,7 @@ - Day of first occurance + Day of first occurrence Dzień pierwszego wystąpienia @@ -1429,9 +1429,9 @@ - TownBulidingsWidget + TownBuildingsWidget - + Buildings Budynki @@ -1450,7 +1450,7 @@ - Suppported + Supported Wspierany @@ -1461,7 +1461,7 @@ Text - Tekst + Text @@ -1856,7 +1856,7 @@ - No template for parameters scecified. Random map cannot be generated. + No template for parameters specified. Random map cannot be generated. Brak szablonu dla wybranych parametrów. Mapa losowa nie może zostać wygenerowana. diff --git a/mapeditor/translation/portuguese.ts b/mapeditor/translation/portuguese.ts index 15353214c..ec9db4515 100644 --- a/mapeditor/translation/portuguese.ts +++ b/mapeditor/translation/portuguese.ts @@ -67,7 +67,7 @@ Limit maximum heroes level - Limite máximo do nível dos heróis + Limit máximo do nível dos heróis @@ -606,7 +606,7 @@ Errors occurred. %1 objects were not updated - Ocorreram erros. %1 objetos não foram atualizados + Ocorreram errors. %1 objetos não foram atualizados @@ -758,7 +758,7 @@ Set required mods based on objects placed on the map. This method may cause problems if you have customized rewards, garrisons, etc from mods - Defina os mods necessários com base nos objetos colocados no mapa. Este método pode causar problemas se você tiver recompensas personalizadas, guarnições, etc., dos mods. + Defina os mods necessários com base nos objetos colocados no mapa. Este método pode causar problems se você tiver recompensas personalizadas, guarnições, etc., dos mods. @@ -1139,7 +1139,7 @@ Message to be displayed on granting of this reward - Mensagem a ser exibida ao conceder esta recompensa + Mensagem a set exibida ao conceder esta recompensa @@ -1394,7 +1394,7 @@ - Day of first occurance + Day of first occurrence Dia da primeira ocorrência @@ -1429,9 +1429,9 @@ - TownBulidingsWidget + TownBuildingsWidget - + Buildings Estruturas @@ -1450,7 +1450,7 @@ - Suppported + Supported Suportado @@ -1472,7 +1472,7 @@ Default language cannot be removed - O idioma padrão não pode ser removido + O idioma padrão não pode set removido @@ -1505,7 +1505,7 @@ Map is allowed for one player and cannot be started - O mapa é permitido para um jogador e não pode ser iniciado + O mapa é permitido para um jogador e não pode set iniciado @@ -1515,7 +1515,7 @@ Armored instance %1 is UNFLAGGABLE but must have NEUTRAL or player owner - A instância protegida %1 não tem bandeira mas precisa ser definida como neutra ou pertencente a um dos jogadores + A instância protegida %1 não tem bandeira mas precisa set definida como neutra ou pertencente a um dos jogadores @@ -1530,7 +1530,7 @@ Prison %1 must be a NEUTRAL - A prisão %1 deve ser NEUTRA + A prisão %1 deve set NEUTRA @@ -1550,7 +1550,7 @@ Hero %1 has an empty type and must be removed - O herói %1 possui um tipo vazio e deve ser removido + O herói %1 possui um tipo vazio e deve set removido @@ -1560,7 +1560,7 @@ Spell scroll %1 doesn't have instance assigned and must be removed - O pergaminho mágico %1 não tem instância atribuída e deve ser removido + O pergaminho mágico %1 não tem instância atribuída e deve set removido @@ -1663,7 +1663,7 @@ Transport artifact - Transportar artefato + Transporter artefato @@ -1856,8 +1856,8 @@ - No template for parameters scecified. Random map cannot be generated. - Sem modelo para os parâmetros especificados. O mapa aleatório não pode ser gerado. + No template for parameters specified. Random map cannot be generated. + Sem modelo para os parâmetros especificados. O mapa aleatório não pode set gerado. @@ -1880,7 +1880,7 @@ From an extracted archive, it Splits TwCrPort, CPRSMALL, FlagPort, ITPA, ITPt, Un32 and Un44 into individual PNG's. - De um arquivo extraído, divide TwCrPort, CPRSMALL, FlagPort, ITPA, ITPt, Un32 e Un44 em PNGs individuais. + De um arquivo extraído, divide TwCrPort, CPRSMALL, FlagPort, ITPA, ITPt, Un32 e Un44 em ONGs individuals. diff --git a/mapeditor/translation/russian.ts b/mapeditor/translation/russian.ts index 8bc89e3ee..7eedc79ea 100644 --- a/mapeditor/translation/russian.ts +++ b/mapeditor/translation/russian.ts @@ -1394,7 +1394,7 @@ - Day of first occurance + Day of first occurrence @@ -1429,9 +1429,9 @@ - TownBulidingsWidget + TownBuildingsWidget - + Buildings Постройки @@ -1450,7 +1450,7 @@ - Suppported + Supported @@ -1856,7 +1856,7 @@ - No template for parameters scecified. Random map cannot be generated. + No template for parameters specified. Random map cannot be generated. diff --git a/mapeditor/translation/spanish.ts b/mapeditor/translation/spanish.ts index 0a95a692a..80586a0e7 100644 --- a/mapeditor/translation/spanish.ts +++ b/mapeditor/translation/spanish.ts @@ -6,7 +6,7 @@ Army settings - Configuracion del Ejército + Configuration del Ejército @@ -834,7 +834,7 @@ Player settings - Configuracion del jugador + Configuration del jugador @@ -1394,7 +1394,7 @@ - Day of first occurance + Day of first occurrence @@ -1429,9 +1429,9 @@ - TownBulidingsWidget + TownBuildingsWidget - + Buildings Edificios @@ -1450,7 +1450,7 @@ - Suppported + Supported @@ -1530,7 +1530,7 @@ Prison %1 must be a NEUTRAL - %1 prisión debe ser NEUTRA + %1 prisión debe set NEUTRA @@ -1663,7 +1663,7 @@ Transport artifact - Transportar artefacto + Transporter artefacto @@ -1791,7 +1791,7 @@ Monster strength - Fuerza de monstruos + Fuerza de monstrous @@ -1856,7 +1856,7 @@ - No template for parameters scecified. Random map cannot be generated. + No template for parameters specified. Random map cannot be generated. @@ -1875,22 +1875,22 @@ Extract original H3 archives into a separate folder. - Extraer archivos originales de H3 en una carpeta separada. + Extraer archivos originals de H3 en una carpeta separada. From an extracted archive, it Splits TwCrPort, CPRSMALL, FlagPort, ITPA, ITPt, Un32 and Un44 into individual PNG's. - Desde un archivo extraído, separa TwCrPort, CPRSMALL, FlagPort, ITPA, ITPt, Un32 y Un44 en imágenes PNG individuales. + Desde un archivo extraído, separa TwCrPort, CPRSMALL, FlagPort, ITPA, ITPt, Un32 y Un44 en imágenes PNG individuals. From an extracted archive, Converts single Images (found in Images folder) from .pcx to png. - Desde un archivo extraído, convierte imágenes individuales (encontradas en la carpeta Imágenes) de .pcx a png. + Desde un archivo extraído, convierte imágenes individuals (encontradas en la carpeta Imágenes) de .pcx a png. Delete original files, for the ones split / converted. - Eliminar archivos originales, por los que se han separado / convertido. + Eliminar archivos originals, por los que se han separado / convertido. diff --git a/mapeditor/translation/ukrainian.ts b/mapeditor/translation/ukrainian.ts index 412982581..c723ad679 100644 --- a/mapeditor/translation/ukrainian.ts +++ b/mapeditor/translation/ukrainian.ts @@ -1394,7 +1394,7 @@ - Day of first occurance + Day of first occurrence @@ -1429,9 +1429,9 @@ - TownBulidingsWidget + TownBuildingsWidget - + Buildings Будівлі @@ -1450,7 +1450,7 @@ - Suppported + Supported @@ -1856,7 +1856,7 @@ - No template for parameters scecified. Random map cannot be generated. + No template for parameters specified. Random map cannot be generated. diff --git a/mapeditor/translation/vietnamese.ts b/mapeditor/translation/vietnamese.ts index 794584578..9fc0646a7 100644 --- a/mapeditor/translation/vietnamese.ts +++ b/mapeditor/translation/vietnamese.ts @@ -1394,7 +1394,7 @@ - Day of first occurance + Day of first occurrence @@ -1429,9 +1429,9 @@ - TownBulidingsWidget + TownBuildingsWidget - + Buildings Công trình @@ -1450,7 +1450,7 @@ - Suppported + Supported @@ -1856,7 +1856,7 @@ - No template for parameters scecified. Random map cannot be generated. + No template for parameters specified. Random map cannot be generated. Không có mẫu cho tham số chỉ định. Bản đồ ngẫu nhiên không thể tạo diff --git a/mapeditor/windownewmap.cpp b/mapeditor/windownewmap.cpp index e1cad1b90..6f2ce83d6 100644 --- a/mapeditor/windownewmap.cpp +++ b/mapeditor/windownewmap.cpp @@ -243,7 +243,7 @@ void WindowNewMap::on_okButton_clicked() //verify map template if(mapGenOptions.getPossibleTemplates().empty()) { - QMessageBox::warning(this, tr("No template"), tr("No template for parameters scecified. Random map cannot be generated.")); + QMessageBox::warning(this, tr("No template"), tr("No template for parameters specified. Random map cannot be generated.")); return; } diff --git a/scripting/erm/ERMInterpreter.cpp b/scripting/erm/ERMInterpreter.cpp index 0d60743e7..664b86d3d 100644 --- a/scripting/erm/ERMInterpreter.cpp +++ b/scripting/erm/ERMInterpreter.cpp @@ -1452,37 +1452,37 @@ bool ERMInterpreter::isATrigger( const ERM::TLine & line ) return false; } -ERM::EVOtions ERMInterpreter::getExpType(const ERM::TVOption & opt) +ERM::EVOptions ERMInterpreter::getExpType(const ERM::TVOption & opt) { struct Visitor { - ERM::EVOtions operator()(const boost::recursive_wrapper&) const + ERM::EVOptions operator()(const boost::recursive_wrapper&) const { - return ERM::EVOtions::VEXP; + return ERM::EVOptions::VEXP; } - ERM::EVOtions operator()(const ERM::TSymbol&) const + ERM::EVOptions operator()(const ERM::TSymbol&) const { - return ERM::EVOtions::SYMBOL; + return ERM::EVOptions::SYMBOL; } - ERM::EVOtions operator()(char) const + ERM::EVOptions operator()(char) const { - return ERM::EVOtions::CHAR; + return ERM::EVOptions::CHAR; } - ERM::EVOtions operator()(double) const + ERM::EVOptions operator()(double) const { - return ERM::EVOtions::DOUBLE; + return ERM::EVOptions::DOUBLE; } - ERM::EVOtions operator()(int) const + ERM::EVOptions operator()(int) const { - return ERM::EVOtions::INT; + return ERM::EVOptions::INT; } - ERM::EVOtions operator()(const ERM::Tcommand&) const + ERM::EVOptions operator()(const ERM::Tcommand&) const { - return ERM::EVOtions::TCMD; + return ERM::EVOptions::TCMD; } - ERM::EVOtions operator()(const ERM::TStringConstant&) const + ERM::EVOptions operator()(const ERM::TStringConstant&) const { - return ERM::EVOtions::STRINGC; + return ERM::EVOptions::STRINGC; } }; const Visitor v; diff --git a/scripting/erm/ERMInterpreter.h b/scripting/erm/ERMInterpreter.h index 748b632e9..c61f9bc51 100644 --- a/scripting/erm/ERMInterpreter.h +++ b/scripting/erm/ERMInterpreter.h @@ -305,7 +305,7 @@ class ERMInterpreter static bool isCMDATrigger(const ERM::Tcommand & cmd); static bool isATrigger(const ERM::TLine & line); - static ERM::EVOtions getExpType(const ERM::TVOption & opt); + static ERM::EVOptions getExpType(const ERM::TVOption & opt); ERM::TLine & retrieveLine(const VERMInterpreter::LinePointer & linePtr); static ERM::TTriggerBase & retrieveTrigger(ERM::TLine & line); public: diff --git a/scripting/erm/ERMParser.h b/scripting/erm/ERMParser.h index f4d8090cd..b6b38b3ec 100644 --- a/scripting/erm/ERMParser.h +++ b/scripting/erm/ERMParser.h @@ -241,7 +241,7 @@ namespace ERM //for #'symbol expression - enum EVOtions{VEXP, SYMBOL, CHAR, DOUBLE, INT, TCMD, STRINGC}; + enum EVOptions{VEXP, SYMBOL, CHAR, DOUBLE, INT, TCMD, STRINGC}; struct TVExp; typedef std::variant, TSymbol, char, double, int, Tcommand, TStringConstant > TVOption; //options in v-expression //v-expression diff --git a/scripting/lua/api/events/BattleEvents.cpp b/scripting/lua/api/events/BattleEvents.cpp index 6196f3c90..895b9cdd7 100644 --- a/scripting/lua/api/events/BattleEvents.cpp +++ b/scripting/lua/api/events/BattleEvents.cpp @@ -42,8 +42,8 @@ const std::vector ApplyDamageProxy::REGISTER_CU true }, { - "getInitalDamage", - LuaMethodWrapper::invoke, + "getInitialDamage", + LuaMethodWrapper::invoke, false }, { diff --git a/scripts/lib/erm/MF.lua b/scripts/lib/erm/MF.lua index fd0506316..6055ea49e 100644 --- a/scripts/lib/erm/MF.lua +++ b/scripts/lib/erm/MF.lua @@ -9,7 +9,7 @@ function MF:new(ERM) end function MF:D(x) - return self.ERM.activeEvent:getInitalDamage() + return self.ERM.activeEvent:getInitialDamage() end function MF:E(x, ...) diff --git a/scripts/lib/erm/UN.lua b/scripts/lib/erm/UN.lua index 1aa3f943d..7ec10257c 100644 --- a/scripts/lib/erm/UN.lua +++ b/scripts/lib/erm/UN.lua @@ -247,7 +247,7 @@ function UN:T(x, town, level, dwellingSlot, creature) error ("UN:T is not implemented") end --- count objects, get coordiantes +-- count objects, get coordinates function UN:U(x, ...) error ("UN:U is not implemented") end diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 4e7595778..b8169b9b6 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -470,11 +470,11 @@ void CGameHandler::handleClientDisconnection(std::shared_ptr c) void CGameHandler::handleReceivedPack(CPackForServer * pack) { //prepare struct informing that action was applied - auto sendPackageResponse = [&](bool succesfullyApplied) + auto sendPackageResponse = [&](bool successfullyApplied) { PackageApplied applied; applied.player = pack->player; - applied.result = succesfullyApplied; + applied.result = successfullyApplied; applied.packType = CTypeList::getInstance().getTypeID(pack); applied.requestID = pack->requestID; pack->c->sendPack(&applied); @@ -2336,7 +2336,7 @@ bool CGameHandler::buildStructure(ObjectInstanceID tid, BuildingID requestedID, if(upgradeNumber >= t->town->creatures.at(level).size()) { - complain(boost::str(boost::format("Error ecountered when building dwelling (bid=%s):" + complain(boost::str(boost::format("Error encountered when building dwelling (bid=%s):" "no creature found (upgrade number %d, level %d!") % buildingID % upgradeNumber % level)); return; @@ -2375,7 +2375,7 @@ bool CGameHandler::buildStructure(ObjectInstanceID tid, BuildingID requestedID, }; //Checks if all requirements will be met with expected building list "buildingsThatWillBe" - auto areRequirementsFullfilled = [&](const BuildingID & buildID) + auto areRequirementsFulfilled = [&](const BuildingID & buildID) { return buildingsThatWillBe.count(buildID); }; @@ -2397,7 +2397,7 @@ bool CGameHandler::buildStructure(ObjectInstanceID tid, BuildingID requestedID, //Prepare structure (list of building ids will be filled later) NewStructures ns; ns.tid = tid; - ns.builded = force ? t->builded : (t->builded+1); + ns.built = force ? t->built : (t->built+1); std::queue buildingsToAdd; buildingsToAdd.push(requestedBuilding); @@ -2415,7 +2415,7 @@ bool CGameHandler::buildStructure(ObjectInstanceID tid, BuildingID requestedID, { auto actualRequirements = t->genBuildingRequirements(autoBuilding->bid); - if(actualRequirements.test(areRequirementsFullfilled)) + if(actualRequirements.test(areRequirementsFulfilled)) buildingsToAdd.push(autoBuilding); } } @@ -2613,7 +2613,7 @@ void CGameHandler::moveArmy(const CArmedInstance *src, const CArmedInstance *dst { //try to merge two other stacks to make place std::pair toMerge; - if (dst->mergableStacks(toMerge, i->first) && allowMerging) + if (dst->mergeableStacks(toMerge, i->first) && allowMerging) { moveStack(StackLocation(dst, toMerge.first), StackLocation(dst, toMerge.second)); //merge toMerge.first into toMerge.second assert(!dst->hasStackAtSlot(toMerge.first)); //we have now a new free slot @@ -3335,7 +3335,7 @@ bool CGameHandler::queryReply(QueryID qid, std::optional answer, Player void CGameHandler::handleTimeEvents() { gs->map->events.sort(evntCmp); - while(gs->map->events.size() && gs->map->events.front().firstOccurence+1 == gs->day) + while(gs->map->events.size() && gs->map->events.front().firstOccurrence+1 == gs->day) { CMapEvent ev = gs->map->events.front(); @@ -3370,11 +3370,11 @@ void CGameHandler::handleTimeEvents() } } //PLAYERS LOOP - if (ev.nextOccurence) + if (ev.nextOccurrence) { gs->map->events.pop_front(); - ev.firstOccurence += ev.nextOccurence; + ev.firstOccurrence += ev.nextOccurrence; auto it = gs->map->events.begin(); while(it != gs->map->events.end() && it->earlierThanOrEqual(ev)) it++; @@ -3395,7 +3395,7 @@ void CGameHandler::handleTimeEvents() void CGameHandler::handleTownEvents(CGTownInstance * town, NewTurn &n) { town->events.sort(evntCmp); - while(town->events.size() && town->events.front().firstOccurence == gs->day) + while(town->events.size() && town->events.front().firstOccurrence == gs->day) { PlayerColor player = town->tempOwner; CCastleEvent ev = town->events.front(); @@ -3453,11 +3453,11 @@ void CGameHandler::handleTownEvents(CGTownInstance * town, NewTurn &n) sendAndApply(&iw); //show dialog } - if (ev.nextOccurence) + if (ev.nextOccurrence) { town->events.pop_front(); - ev.firstOccurence += ev.nextOccurence; + ev.firstOccurrence += ev.nextOccurrence; auto it = town->events.begin(); while(it != town->events.end() && it->earlierThanOrEqual(ev)) it++; @@ -3663,9 +3663,9 @@ bool CGameHandler::buildBoat(ObjectInstanceID objid, PlayerColor playerID) TResources boatCost; obj->getBoatCost(boatCost); - TResources aviable = getPlayerState(playerID)->resources; + TResources available = getPlayerState(playerID)->resources; - if (!aviable.canAfford(boatCost)) + if (!available.canAfford(boatCost)) { complain("Not enough resources to build a boat!"); return false; diff --git a/server/CVCMIServer.cpp b/server/CVCMIServer.cpp index f6c6a4643..9aee05910 100644 --- a/server/CVCMIServer.cpp +++ b/server/CVCMIServer.cpp @@ -690,7 +690,7 @@ void CVCMIServer::setPlayer(PlayerColor clickedColor) //identify clicked player int clickedNameID = 0; //number of player - zero means AI, assume it initially if(clicked.isControlledByHuman()) - clickedNameID = *(clicked.connectedPlayerIDs.begin()); //if not AI - set appropiate ID + clickedNameID = *(clicked.connectedPlayerIDs.begin()); //if not AI - set appropriate ID if(clickedNameID > 0 && playerToRestore.id == clickedNameID) //player to restore is about to being replaced -> put him back to the old place { @@ -752,7 +752,7 @@ void CVCMIServer::setPlayerName(PlayerColor color, std::string name) if(player.connectedPlayerIDs.empty()) return; - int nameID = *(player.connectedPlayerIDs.begin()); //if not AI - set appropiate ID + int nameID = *(player.connectedPlayerIDs.begin()); //if not AI - set appropriate ID playerNames[nameID].name = name; setPlayerConnectedId(player, nameID); diff --git a/server/GlobalLobbyProcessor.cpp b/server/GlobalLobbyProcessor.cpp index 7f9a49820..7effca617 100644 --- a/server/GlobalLobbyProcessor.cpp +++ b/server/GlobalLobbyProcessor.cpp @@ -97,7 +97,7 @@ void GlobalLobbyProcessor::receiveOperationFailed(const JsonNode & json) void GlobalLobbyProcessor::receiveServerLoginSuccess(const JsonNode & json) { // no-op, wait just for any new commands from lobby - logGlobal->info("Lobby: Succesfully connected to lobby server"); + logGlobal->info("Lobby: Successfully connected to lobby server"); owner.startAcceptingIncomingConnections(); } diff --git a/server/NetPacksLobbyServer.cpp b/server/NetPacksLobbyServer.cpp index 2303bc3e7..2882ce305 100644 --- a/server/NetPacksLobbyServer.cpp +++ b/server/NetPacksLobbyServer.cpp @@ -32,7 +32,7 @@ void ClientPermissionsCheckerNetPackVisitor::visitForLobby(CPackForLobby & pack) void ApplyOnServerAfterAnnounceNetPackVisitor::visitForLobby(CPackForLobby & pack) { - // Propogate options after every CLobbyPackToServer + // Propagate options after every CLobbyPackToServer if(pack.isForServer()) { srv.updateAndPropagateLobbyState(); diff --git a/server/battles/BattleActionProcessor.cpp b/server/battles/BattleActionProcessor.cpp index d97d9530b..61e13c26a 100644 --- a/server/battles/BattleActionProcessor.cpp +++ b/server/battles/BattleActionProcessor.cpp @@ -625,7 +625,7 @@ int BattleActionProcessor::moveStack(const CBattleInfoCallback & battle, int sta return 0; //initing necessary tables - auto accessibility = battle.getAccesibility(curStack); + auto accessibility = battle.getAccessibility(curStack); std::set passed; //Ignore obstacles on starting position passed.insert(curStack->getPosition()); diff --git a/server/battles/BattleFlowProcessor.cpp b/server/battles/BattleFlowProcessor.cpp index 93474ef0c..eadf4e65e 100644 --- a/server/battles/BattleFlowProcessor.cpp +++ b/server/battles/BattleFlowProcessor.cpp @@ -139,7 +139,7 @@ void BattleFlowProcessor::trySummonGuardians(const CBattleInfoCallback & battle, return; std::shared_ptr summonInfo = stack->getBonus(Selector::type()(BonusType::SUMMON_GUARDIANS)); - auto accessibility = battle.getAccesibility(); + auto accessibility = battle.getAccessibility(); CreatureID creatureData = summonInfo->subtype.as(); std::vector targetHexes; const bool targetIsBig = stack->unitType()->isDoubleWide(); //target = creature to guard diff --git a/server/battles/BattleResultProcessor.cpp b/server/battles/BattleResultProcessor.cpp index 6244c78fc..7416094ec 100644 --- a/server/battles/BattleResultProcessor.cpp +++ b/server/battles/BattleResultProcessor.cpp @@ -426,7 +426,7 @@ void BattleResultProcessor::endBattleConfirm(const CBattleInfoCallback & battle) iw.text.appendLocalString (EMetaText::GENERAL_TXT, 30); //You have captured enemy artifact - for (auto art : arts) //TODO; separate function to display loot for various ojects? + for (auto art : arts) //TODO; separate function to display loot for various objects? { if (art->artType->getId() == ArtifactID::SPELL_SCROLL) iw.components.emplace_back(ComponentType::SPELL_SCROLL, art->getScrollSpellID()); diff --git a/server/processors/TurnOrderProcessor.cpp b/server/processors/TurnOrderProcessor.cpp index 9499558c2..924ec648a 100644 --- a/server/processors/TurnOrderProcessor.cpp +++ b/server/processors/TurnOrderProcessor.cpp @@ -182,7 +182,7 @@ bool TurnOrderProcessor::computeCanActSimultaneously(PlayerColor active, PlayerC if (!gameHandler->getStartInfo()->simturnsInfo.allowHumanWithAI) return false; - // only one AI and one human can play simultaneoulsy from single connection + // only one AI and one human can play simultaneously from single connection if (activeInfo->human == waitingInfo->human) return false; } diff --git a/server/queries/CQuery.cpp b/server/queries/CQuery.cpp index 0580b75ed..7e18b7ec9 100644 --- a/server/queries/CQuery.cpp +++ b/server/queries/CQuery.cpp @@ -18,7 +18,7 @@ #include "../../lib/networkPacks/PacksForServer.h" template -std::string formatContainer(const Container & c, std::string delimeter = ", ", std::string opener = "(", std::string closer=")") +std::string formatContainer(const Container & c, std::string delimiter = ", ", std::string opener = "(", std::string closer=")") { std::string ret = opener; auto itr = std::begin(c); @@ -27,7 +27,7 @@ std::string formatContainer(const Container & c, std::string delimeter = ", ", s ret += std::to_string(*itr); while(++itr != std::end(c)) { - ret += delimeter; + ret += delimiter; ret += std::to_string(*itr); } } diff --git a/test/erm/ERM_MF.cpp b/test/erm/ERM_MF.cpp index 36613488d..1759d02c4 100644 --- a/test/erm/ERM_MF.cpp +++ b/test/erm/ERM_MF.cpp @@ -53,7 +53,7 @@ TEST_F(ERM_MF, ChangesDamage) SCOPED_TRACE("\n" + subject->code); runClientServer(); - EXPECT_CALL(event, getInitalDamage()).WillOnce(Return(23450)); + EXPECT_CALL(event, getInitialDamage()).WillOnce(Return(23450)); EXPECT_CALL(event, setDamage(Eq(23460))).Times(1); eventBus.executeEvent(event); diff --git a/test/erm/ExamplesTest.cpp b/test/erm/ExamplesTest.cpp index f24e409d0..7639f7d8b 100644 --- a/test/erm/ExamplesTest.cpp +++ b/test/erm/ExamplesTest.cpp @@ -37,7 +37,7 @@ public: { } - void setDefaultExpectaions() + void setDefaultExpectations() { EXPECT_CALL(infoMock, getLocalPlayer()).WillRepeatedly(Return(PlayerColor(3))); EXPECT_CALL(serverMock, apply(Matcher(_))).WillRepeatedly(Invoke(this, &ExamplesTest::onCommit)); @@ -83,7 +83,7 @@ protected: TEST_F(ExamplesTest, ALL) { - setDefaultExpectaions(); + setDefaultExpectations(); auto sources = CResourceHandler::get()->getFilteredFiles([](const ResourceID & ident) { return ident.getType() == EResType::ERM && boost::algorithm::starts_with(ident.getName(), "SCRIPTS/TEST/ERM/"); diff --git a/test/game/CGameStateTest.cpp b/test/game/CGameStateTest.cpp index a7c5f3b65..00da8456f 100644 --- a/test/game/CGameStateTest.cpp +++ b/test/game/CGameStateTest.cpp @@ -251,7 +251,7 @@ TEST_F(CGameStateTest, DISABLED_issue2765) info.count = 1; info.type = CreatureID(69); info.side = BattleSide::ATTACKER; - info.position = gameState->currentBattles.front()->getAvaliableHex(info.type, info.side); + info.position = gameState->currentBattles.front()->getAvailableHex(info.type, info.side); info.summoned = false; BattleUnitsChanged pack; @@ -347,7 +347,7 @@ TEST_F(CGameStateTest, DISABLED_battleResurrection) info.count = 10; info.type = CreatureID(13); info.side = BattleSide::ATTACKER; - info.position = gameState->currentBattles.front()->getAvaliableHex(info.type, info.side); + info.position = gameState->currentBattles.front()->getAvailableHex(info.type, info.side); info.summoned = false; BattleUnitsChanged pack; @@ -362,7 +362,7 @@ TEST_F(CGameStateTest, DISABLED_battleResurrection) info.count = 10; info.type = CreatureID(13); info.side = BattleSide::DEFENDER; - info.position = gameState->currentBattles.front()->getAvaliableHex(info.type, info.side); + info.position = gameState->currentBattles.front()->getAvailableHex(info.type, info.side); info.summoned = false; BattleUnitsChanged pack; diff --git a/test/mock/mock_events_ApplyDamage.h b/test/mock/mock_events_ApplyDamage.h index 492fa5da3..4d39b4a33 100644 --- a/test/mock/mock_events_ApplyDamage.h +++ b/test/mock/mock_events_ApplyDamage.h @@ -20,7 +20,7 @@ class ApplyDamageMock : public ApplyDamage { public: MOCK_CONST_METHOD0(isEnabled, bool()); - MOCK_CONST_METHOD0(getInitalDamage, int64_t()); + MOCK_CONST_METHOD0(getInitialDamage, int64_t()); MOCK_CONST_METHOD0(getDamage, int64_t()); MOCK_METHOD1(setDamage, void(int64_t)); MOCK_CONST_METHOD0(getTarget, const battle::Unit *()); diff --git a/test/spells/AbilityCasterTest.cpp b/test/spells/AbilityCasterTest.cpp index 02c3a9e44..1061e2331 100644 --- a/test/spells/AbilityCasterTest.cpp +++ b/test/spells/AbilityCasterTest.cpp @@ -65,7 +65,7 @@ TEST_F(AbilityCasterTest, MagicAbilityAffectedByGenericBonus) EXPECT_EQ(subject->getSpellSchoolLevel(&spellMock), 2); } -TEST_F(AbilityCasterTest, MagicAbilityIngoresSchoolBonus) +TEST_F(AbilityCasterTest, MagicAbilityIgnoresSchoolBonus) { EXPECT_CALL(spellMock, getLevel()).WillRepeatedly(Return(1)); diff --git a/test/spells/effects/DispelTest.cpp b/test/spells/effects/DispelTest.cpp index fb53586b3..5817293d1 100644 --- a/test/spells/effects/DispelTest.cpp +++ b/test/spells/effects/DispelTest.cpp @@ -34,7 +34,7 @@ public: { } - void setDefaultExpectaions() + void setDefaultExpectations() { EXPECT_CALL(mechanicsMock, spells()).Times(AnyNumber()); @@ -82,7 +82,7 @@ TEST_F(DispelTest, DISABLED_ApplicableToAliveUnitWithTimedEffect) EXPECT_CALL(mechanicsMock, isSmart()).WillOnce(Return(false)); EXPECT_CALL(mechanicsMock, getSpellIndex()).Times(AtLeast(1)).WillRepeatedly(Return(neutralID.toEnum())); - setDefaultExpectaions(); + setDefaultExpectations(); unitsFake.setDefaultBonusExpectations(); EffectTarget target; @@ -110,7 +110,7 @@ TEST_F(DispelTest, DISABLED_IgnoresOwnEffects) EXPECT_CALL(mechanicsMock, ownerMatches(Eq(&unit))).Times(AtMost(1)).WillRepeatedly(Return(true)); EXPECT_CALL(mechanicsMock, getSpellIndex()).Times(AtLeast(1)).WillRepeatedly(Return(neutralID.toEnum())); - setDefaultExpectaions(); + setDefaultExpectations(); unitsFake.setDefaultBonusExpectations(); EffectTarget target; @@ -212,7 +212,7 @@ TEST_F(DispelApplyTest, DISABLED_RemovesEffects) EXPECT_CALL(serverMock, apply(Matcher(_))).Times(1); EXPECT_CALL(serverMock, describeChanges()).WillRepeatedly(Return(false)); - setDefaultExpectaions(); + setDefaultExpectations(); unitsFake.setDefaultBonusExpectations(); setupDefaultRNG(); diff --git a/test/spells/effects/SummonTest.cpp b/test/spells/effects/SummonTest.cpp index fbc322340..ebbd5563c 100644 --- a/test/spells/effects/SummonTest.cpp +++ b/test/spells/effects/SummonTest.cpp @@ -164,7 +164,7 @@ public: { } - void setDefaultExpectaions() + void setDefaultExpectations() { EXPECT_CALL(mechanicsMock, creatures()).Times(AnyNumber()); EXPECT_CALL(creatureServiceMock, getById(Eq(toSummon))).WillRepeatedly(Return(&toSummonType)); @@ -221,7 +221,7 @@ protected: TEST_P(SummonApplyTest, DISABLED_SpawnsNewUnit) { - setDefaultExpectaions(); + setDefaultExpectations(); EXPECT_CALL(*battleFake, nextUnitId()).WillOnce(Return(unitId)); EXPECT_CALL(*battleFake, addUnit(Eq(unitId), _)).WillOnce(Invoke(this, &SummonApplyTest::onUnitAdded)); @@ -242,7 +242,7 @@ TEST_P(SummonApplyTest, DISABLED_SpawnsNewUnit) TEST_P(SummonApplyTest, DISABLED_UpdatesOldUnit) { - setDefaultExpectaions(); + setDefaultExpectations(); acquired = std::make_shared(); acquired->addNewBonus(std::make_shared(BonusDuration::PERMANENT, BonusType::STACK_HEALTH, BonusSource::CREATURE_ABILITY, unitHealth, BonusSourceID())); diff --git a/test/spells/effects/TimedTest.cpp b/test/spells/effects/TimedTest.cpp index 541a35ecf..bfd4a61e9 100644 --- a/test/spells/effects/TimedTest.cpp +++ b/test/spells/effects/TimedTest.cpp @@ -51,7 +51,7 @@ public: { } - void setDefaultExpectaions() + void setDefaultExpectations() { unitsFake.setDefaultBonusExpectations(); EXPECT_CALL(mechanicsMock, getSpellIndex()).WillRepeatedly(Return(spellIndex)); @@ -116,7 +116,7 @@ TEST_P(TimedApplyTest, DISABLED_ChangesBonuses) EXPECT_CALL(*battleFake, updateUnitBonus(Eq(unitId),_)).WillOnce(SaveArg<1>(&actualBonus)); } - setDefaultExpectaions(); + setDefaultExpectations(); EXPECT_CALL(serverMock, apply(Matcher(_))).Times(1); diff --git a/test/testdata/ObjectPropertyTest/objects.ex.json b/test/testdata/ObjectPropertyTest/objects.ex.json index daffa0120..ac2db97af 100644 --- a/test/testdata/ObjectPropertyTest/objects.ex.json +++ b/test/testdata/ObjectPropertyTest/objects.ex.json @@ -257,7 +257,7 @@ "x" : 6, "y" : 1, "options" : { - "text" : "Previus one have random sign" + "text" : "Previous one have random sign" } }, "oceanBottle_11" : { @@ -7376,7 +7376,7 @@ "x" : 31, "y" : 22, "options" : { - "text" : "Arts: have spellbook, head: Admirals hat, shoulders: angel wings, right hand: armagedons blade; left hand: shield of damned; torso: armor of wonder" + "text" : "Arts: have spellbook, head: Admirals hat, shoulders: angel wings, right hand: armageddons blade; left hand: shield of damned; torso: armor of wonder" } }, "sign_272" : { diff --git a/test/testdata/ObjectPropertyTest/objects.json b/test/testdata/ObjectPropertyTest/objects.json index 0baed931b..58ef8e38f 100644 --- a/test/testdata/ObjectPropertyTest/objects.json +++ b/test/testdata/ObjectPropertyTest/objects.json @@ -257,7 +257,7 @@ "x" : 6, "y" : 1, "options" : { - "text" : "Previus one have random sign" + "text" : "Previous one have random sign" } }, "oceanBottle_11" : { @@ -7376,7 +7376,7 @@ "x" : 31, "y" : 22, "options" : { - "text" : "Arts: have spellbook, head: Admirals hat, shoulders: angel wings, right hand: armagedons blade; left hand: shield of damned; torso: armor of wonder" + "text" : "Arts: have spellbook, head: Admirals hat, shoulders: angel wings, right hand: armageddons blade; left hand: shield of damned; torso: armor of wonder" } }, "sign_272" : { diff --git a/test/vcai/ResurceManagerTest.cpp b/test/vcai/ResourceManagerTest.cpp similarity index 90% rename from test/vcai/ResurceManagerTest.cpp rename to test/vcai/ResourceManagerTest.cpp index 7a4e4920e..abeba4748 100644 --- a/test/vcai/ResurceManagerTest.cpp +++ b/test/vcai/ResourceManagerTest.cpp @@ -34,7 +34,7 @@ struct ResourceManagerTest : public Test//, public IResourceManager { rm = make_unique>(&gcm, &aim); - //note: construct new goal for modfications + //note: construct new goal for modifications invalidGoal = sptr(StrictMock()); gatherArmy = sptr(StrictMock()); buildThis = sptr(StrictMock()); @@ -76,8 +76,8 @@ TEST_F(ResourceManagerTest, canAffordMaths) TResources armyCost(0, 0, 0, 0, 0, 0, 54321); EXPECT_FALSE(rm->canAfford(armyCost)); - rm->reserveResoures(armyCost, gatherArmy); - EXPECT_FALSE(rm->canAfford(buildingCost)) << "Reserved value should be substracted from free resources"; + rm->reserveResources(armyCost, gatherArmy); + EXPECT_FALSE(rm->canAfford(buildingCost)) << "Reserved value should be subtracted from free resources"; } TEST_F(ResourceManagerTest, notifyGoalImplemented) @@ -88,12 +88,12 @@ TEST_F(ResourceManagerTest, notifyGoalImplemented) EXPECT_FALSE(rm->hasTasksLeft()); TResources res(0,0,0,0,0,0,12345); - rm->reserveResoures(res, invalidGoal); + rm->reserveResources(res, invalidGoal); ASSERT_FALSE(rm->hasTasksLeft()) << "Can't push Invalid goal"; EXPECT_FALSE(rm->notifyGoalCompleted(invalidGoal)); EXPECT_FALSE(rm->notifyGoalCompleted(gatherArmy)) << "Queue should be empty"; - rm->reserveResoures(res, gatherArmy); + rm->reserveResources(res, gatherArmy); EXPECT_TRUE(rm->notifyGoalCompleted(gatherArmy)) << "Not implemented"; //TODO: try it with not a copy EXPECT_FALSE(rm->notifyGoalCompleted(gatherArmy)); //already completed } @@ -102,9 +102,9 @@ TEST_F(ResourceManagerTest, notifyFulfillsAll) { TResources res; ASSERT_TRUE(buildAny->fulfillsMe(buildThis)) << "Goal dependency implemented incorrectly"; //TODO: goal mock? - rm->reserveResoures(res, buildAny); - rm->reserveResoures(res, buildAny); - rm->reserveResoures(res, buildAny); + rm->reserveResources(res, buildAny); + rm->reserveResources(res, buildAny); + rm->reserveResources(res, buildAny); ASSERT_TRUE(rm->hasTasksLeft()); //regardless if duplicates are allowed or not rm->notifyGoalCompleted(buildThis); ASSERT_FALSE(rm->hasTasksLeft()) << "BuildThis didn't remove Build Any!"; @@ -129,9 +129,9 @@ TEST_F(ResourceManagerTest, queueOrder) buildVeryHigh->setpriority(10).setbid(5); TResources price(0, 0, 0, 0, 0, 0, 1000); - rm->reserveResoures(price, buildLow); - rm->reserveResoures(price, buildHigh); - rm->reserveResoures(price, buildMed); + rm->reserveResources(price, buildLow); + rm->reserveResources(price, buildHigh); + rm->reserveResources(price, buildMed); ON_CALL(gcm, getResourceAmount()) .WillByDefault(Return(TResources(0,0,0,0,0,0,4000,0))); //we can afford 4 top goals @@ -139,8 +139,8 @@ TEST_F(ResourceManagerTest, queueOrder) auto goal = rm->whatToDo(); EXPECT_EQ(goal->goalType, Goals::BUILD_STRUCTURE); ASSERT_EQ(rm->whatToDo()->bid, 4); - rm->reserveResoures(price, buildBit); - rm->reserveResoures(price, buildVeryHigh); + rm->reserveResources(price, buildBit); + rm->reserveResources(price, buildVeryHigh); goal = rm->whatToDo(); EXPECT_EQ(goal->goalType, Goals::BUILD_STRUCTURE); ASSERT_EQ(goal->bid, 5); @@ -171,7 +171,7 @@ TEST_F(ResourceManagerTest, updateGoalImplemented) EXPECT_FALSE(rm->updateGoal(buildThis)); //try update with no objectives -> fail - rm->reserveResoures(res, buildThis); + rm->reserveResources(res, buildThis); ASSERT_TRUE(rm->hasTasksLeft()); buildThis->setpriority(4.444f); @@ -224,11 +224,11 @@ TEST_F(ResourceManagerTest, freeResourcesWithManyGoals) ASSERT_EQ(rm->freeResources(), TResources(20, 10, 20, 10, 10, 10, 20000, 0)); - rm->reserveResoures(TResources(0, 4, 0, 0, 0, 0, 13000), gatherArmy); + rm->reserveResources(TResources(0, 4, 0, 0, 0, 0, 13000), gatherArmy); ASSERT_EQ(rm->freeResources(), TResources(20, 6, 20, 10, 10, 10, 7000, 0)); - rm->reserveResoures(TResources(5, 4, 5, 4, 4, 4, 5000), buildThis); + rm->reserveResources(TResources(5, 4, 5, 4, 4, 4, 5000), buildThis); ASSERT_EQ(rm->freeResources(), TResources(15, 2, 15, 6, 6, 6, 2000, 0)); - rm->reserveResoures(TResources(0, 0, 0, 0, 0, 0, 2500), recruitHero); + rm->reserveResources(TResources(0, 0, 0, 0, 0, 0, 2500), recruitHero); auto res = rm->freeResources(); EXPECT_EQ(res[EGameResID::GOLD], 0) << "We should have 0 gold left"; diff --git a/test/vcai/mock_ResourceManager.cpp b/test/vcai/mock_ResourceManager.cpp index 577a6efe4..b3c701457 100644 --- a/test/vcai/mock_ResourceManager.cpp +++ b/test/vcai/mock_ResourceManager.cpp @@ -11,9 +11,9 @@ #include "mock_ResourceManager.h" -void ResourceManagerMock::reserveResoures(const TResources &res, Goals::TSubgoal goal) +void ResourceManagerMock::reserveResources(const TResources &res, Goals::TSubgoal goal) { - ResourceManager::reserveResoures(res, goal); + ResourceManager::reserveResources(res, goal); } bool ResourceManagerMock::updateGoal(Goals::TSubgoal goal) diff --git a/test/vcai/mock_ResourceManager.h b/test/vcai/mock_ResourceManager.h index 3d5a317c8..e308e0185 100644 --- a/test/vcai/mock_ResourceManager.h +++ b/test/vcai/mock_ResourceManager.h @@ -22,7 +22,7 @@ class ResourceManagerMock : public ResourceManager public: using ResourceManager::ResourceManager; //access protected members, TODO: consider other architecture? - void reserveResoures(const TResources &res, Goals::TSubgoal goal = Goals::TSubgoal()) override; + void reserveResources(const TResources &res, Goals::TSubgoal goal = Goals::TSubgoal()) override; bool updateGoal(Goals::TSubgoal goal) override; bool notifyGoalCompleted(Goals::TSubgoal goal) override; }; \ No newline at end of file