diff --git a/AI/BattleAI/StdInc.cpp b/AI/BattleAI/StdInc.cpp index c8f4ddf05..f500fe6d0 100644 --- a/AI/BattleAI/StdInc.cpp +++ b/AI/BattleAI/StdInc.cpp @@ -1,2 +1,2 @@ // Creates the precompiled header -#include "StdInc.h" \ No newline at end of file +#include "StdInc.h" diff --git a/AI/EmptyAI/StdInc.cpp b/AI/EmptyAI/StdInc.cpp index c8f4ddf05..f500fe6d0 100644 --- a/AI/EmptyAI/StdInc.cpp +++ b/AI/EmptyAI/StdInc.cpp @@ -1,2 +1,2 @@ // Creates the precompiled header -#include "StdInc.h" \ No newline at end of file +#include "StdInc.h" diff --git a/AI/EmptyAI/exp_funcs.cpp b/AI/EmptyAI/exp_funcs.cpp index bc91f5196..5779c77c9 100644 --- a/AI/EmptyAI/exp_funcs.cpp +++ b/AI/EmptyAI/exp_funcs.cpp @@ -16,4 +16,4 @@ extern "C" DLL_EXPORT void GetAiName(char* name) extern "C" DLL_EXPORT void GetNewAI(std::shared_ptr &out) { out = std::make_shared(); -} \ No newline at end of file +} diff --git a/AI/StupidAI/StdInc.cpp b/AI/StupidAI/StdInc.cpp index c8f4ddf05..f500fe6d0 100644 --- a/AI/StupidAI/StdInc.cpp +++ b/AI/StupidAI/StdInc.cpp @@ -1,2 +1,2 @@ // Creates the precompiled header -#include "StdInc.h" \ No newline at end of file +#include "StdInc.h" diff --git a/AI/VCAI/AIUtility.cpp b/AI/VCAI/AIUtility.cpp index 7cc22fe38..fe187f85b 100644 --- a/AI/VCAI/AIUtility.cpp +++ b/AI/VCAI/AIUtility.cpp @@ -360,7 +360,7 @@ bool canBeEmbarkmentPoint(const TerrainTile *t, bool fromWater) int3 whereToExplore(HeroPtr h) { TimeCheck tc ("where to explore"); - int radius = h->getSightRadious(); + int radius = h->getSightRadius(); int3 hpos = h->visitablePos(); auto sm = ai->getCachedSectorMap(h); diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index 666c9c8f7..7ddc20207 100644 --- a/AI/VCAI/VCAI.cpp +++ b/AI/VCAI/VCAI.cpp @@ -2554,7 +2554,7 @@ int3 VCAI::explorationBestNeighbour(int3 hpos, int radius, HeroPtr h) int3 VCAI::explorationNewPoint(HeroPtr h) { - int radius = h->getSightRadious(); + int radius = h->getSightRadius(); CCallback * cbp = cb.get(); const CGHeroInstance * hero = h.get(); @@ -2603,7 +2603,7 @@ int3 VCAI::explorationNewPoint(HeroPtr h) int3 VCAI::explorationDesperate(HeroPtr h) { auto sm = getCachedSectorMap(h); - int radius = h->getSightRadious(); + int radius = h->getSightRadius(); std::vector > tiles; //tiles[distance_to_fow] tiles.resize(radius); diff --git a/lib/CGameState.cpp b/lib/CGameState.cpp index cc3ded16b..9b6618544 100644 --- a/lib/CGameState.cpp +++ b/lib/CGameState.cpp @@ -988,10 +988,10 @@ void CGameState::initGrailPosition() { logGlobal->debugStream() << "\tPicking grail position"; //pick grail location - if(map->grailPos.x < 0 || map->grailRadious) //grail not set or set within a radius around some place + if(map->grailPos.x < 0 || map->grailRadius) //grail not set or set within a radius around some place { - if(!map->grailRadious) //radius not given -> anywhere on map - map->grailRadious = map->width * 2; + if(!map->grailRadius) //radius not given -> anywhere on map + map->grailRadius = map->width * 2; std::vector allowedPos; static const int BORDER_WIDTH = 9; // grail must be at least 9 tiles away from border @@ -1008,7 +1008,7 @@ void CGameState::initGrailPosition() && !t.visitable && t.terType != ETerrainType::WATER && t.terType != ETerrainType::ROCK - && map->grailPos.dist2dSQ(int3(i, j, k)) <= (map->grailRadious * map->grailRadious)) + && map->grailPos.dist2dSQ(int3(i, j, k)) <= (map->grailRadius * map->grailRadius)) allowedPos.push_back(int3(i,j,k)); } } @@ -1638,7 +1638,7 @@ void CGameState::initFogOfWar() if(!obj || !vstd::contains(elem.second.players, obj->tempOwner)) continue; //not a flagged object std::unordered_set tiles; - getTilesInRange(tiles, obj->getSightCenter(), obj->getSightRadious(), obj->tempOwner, 1); + getTilesInRange(tiles, obj->getSightCenter(), obj->getSightRadius(), obj->tempOwner, 1); for(int3 tile : tiles) { elem.second.fogOfWarMap[tile.x][tile.y][tile.z] = 1; diff --git a/lib/CPathfinder.cpp b/lib/CPathfinder.cpp index 5e778e541..1ff5b1f15 100644 --- a/lib/CPathfinder.cpp +++ b/lib/CPathfinder.cpp @@ -646,10 +646,10 @@ void CPathfinder::initializePatrol() auto state = PATROL_NONE; if(hero->patrol.patrolling && !getPlayer(hero->tempOwner)->human) { - if(hero->patrol.patrolRadious) + if(hero->patrol.patrolRadius) { state = PATROL_RADIUS; - gs->getTilesInRange(patrolTiles, hero->patrol.initialPos, hero->patrol.patrolRadious, boost::optional(), 0, true); + gs->getTilesInRange(patrolTiles, hero->patrol.initialPos, hero->patrol.patrolRadius, boost::optional(), 0, true); } else state = PATROL_LOCKED; diff --git a/lib/HeroBonus.h b/lib/HeroBonus.h index 82f1756dc..db81b354c 100644 --- a/lib/HeroBonus.h +++ b/lib/HeroBonus.h @@ -33,7 +33,7 @@ class CSelector : std::function public: CSelector() {} template - CSelector(const T &t, //SFINAE trick -> include this c-tor in overload resolution only if parameter is class + CSelector(const T &t, //SFINAE trick -> include this c-tor in overload resolution only if parameter is class //(includes functors, lambdas) or function. Without that VC is going mad about ambiguities. typename std::enable_if < boost::mpl::or_ < std::is_class, std::is_function> ::value>::type *dummy = nullptr) : TBase(t) @@ -79,7 +79,7 @@ public: BONUS_NAME(MORALE) \ BONUS_NAME(LUCK) \ BONUS_NAME(PRIMARY_SKILL) /*uses subtype to pick skill; additional info if set: 1 - only melee, 2 - only distance*/ \ - BONUS_NAME(SIGHT_RADIOUS) \ + BONUS_NAME(SIGHT_RADIOUS) /*the correct word is RADIUS, but this one's already used in mods */\ BONUS_NAME(MANA_REGENERATION) /*points per turn apart from normal (1 + mysticism)*/ \ BONUS_NAME(FULL_MANA_REGENERATION) /*all mana points are replenished every day*/ \ BONUS_NAME(NONEVIL_ALIGNMENT_MIX) /*good and neutral creatures can be mixed without morale penalty*/ \ @@ -219,7 +219,7 @@ public: BONUS_NAME(VISIONS) /* subtype - spell level */\ BONUS_NAME(NO_TERRAIN_PENALTY) /* subtype - terrain type */\ /* end of list */ - + #define BONUS_SOURCE_LIST \ BONUS_SOURCE(ARTIFACT)\ @@ -345,7 +345,7 @@ struct DLL_LINKAGE Bonus static bool NTurns(const Bonus *hb) { return hb->duration & Bonus::N_TURNS; - } + } static bool OneDay(const Bonus *hb) { return hb->duration & Bonus::ONE_DAY; @@ -754,7 +754,7 @@ public: : ptr(Ptr) { } - + CSelector operator()(const T &valueToCompareAgainst) const { auto ptr2 = ptr; //We need a COPY because we don't want to reference this (might be outlived by lambda) diff --git a/lib/Interprocess.h b/lib/Interprocess.h index 84ac21324..80a1de9c1 100644 --- a/lib/Interprocess.h +++ b/lib/Interprocess.h @@ -55,4 +55,4 @@ struct SharedMem delete mr; boost::interprocess::shared_memory_object::remove("vcmi_memory"); } -}; \ No newline at end of file +}; diff --git a/lib/NetPacksLib.cpp b/lib/NetPacksLib.cpp index 53b94c84f..d900a1ce8 100644 --- a/lib/NetPacksLib.cpp +++ b/lib/NetPacksLib.cpp @@ -223,7 +223,7 @@ DLL_LINKAGE void FoWChange::applyGs( CGameState *gs ) case Obj::TOWN: case Obj::ABANDONED_MINE: if(vstd::contains(team->players, o->tempOwner)) //check owned observators - gs->getTilesInRange(tilesRevealed, o->getSightCenter(), o->getSightRadious(), o->tempOwner, 1); + gs->getTilesInRange(tilesRevealed, o->getSightCenter(), o->getSightRadius(), o->tempOwner, 1); break; } } diff --git a/lib/ResourceSet.cpp b/lib/ResourceSet.cpp index 42fb44862..f462b659b 100644 --- a/lib/ResourceSet.cpp +++ b/lib/ResourceSet.cpp @@ -113,4 +113,4 @@ Res::ResourceSet::nziterator::nziterator(const ResourceSet &RS) if(!valid()) advance(); -} \ No newline at end of file +} diff --git a/lib/StdInc.cpp b/lib/StdInc.cpp index c8f4ddf05..f500fe6d0 100644 --- a/lib/StdInc.cpp +++ b/lib/StdInc.cpp @@ -1,2 +1,2 @@ // Creates the precompiled header -#include "StdInc.h" \ No newline at end of file +#include "StdInc.h" diff --git a/lib/StdInc.h b/lib/StdInc.h index 76e828312..2f2dd2f58 100644 --- a/lib/StdInc.h +++ b/lib/StdInc.h @@ -4,4 +4,4 @@ // This header should be treated as a pre compiled header file(PCH) in the compiler building settings. -// Here you can add specific libraries and macros which are specific to this project. \ No newline at end of file +// Here you can add specific libraries and macros which are specific to this project. diff --git a/lib/VCMIDirs.h b/lib/VCMIDirs.h index fa1e43221..0e604346e 100644 --- a/lib/VCMIDirs.h +++ b/lib/VCMIDirs.h @@ -55,4 +55,4 @@ class DLL_LINKAGE IVCMIDirs namespace VCMIDirs { extern DLL_LINKAGE const IVCMIDirs& get(); -} \ No newline at end of file +} diff --git a/lib/mapObjects/CGHeroInstance.cpp b/lib/mapObjects/CGHeroInstance.cpp index 097cdc265..d6cd8657b 100644 --- a/lib/mapObjects/CGHeroInstance.cpp +++ b/lib/mapObjects/CGHeroInstance.cpp @@ -1067,7 +1067,7 @@ int3 CGHeroInstance::getSightCenter() const return getPosition(false); }*/ -int CGHeroInstance::getSightRadious() const +int CGHeroInstance::getSightRadius() const { return 5 + getSecSkillLevel(SecondarySkill::SCOUTING) + valOfBonuses(Bonus::SIGHT_RADIOUS); //default + scouting } diff --git a/lib/mapObjects/CGHeroInstance.h b/lib/mapObjects/CGHeroInstance.h index 94c0c8bbc..dfaf979fb 100644 --- a/lib/mapObjects/CGHeroInstance.h +++ b/lib/mapObjects/CGHeroInstance.h @@ -76,10 +76,10 @@ public: struct DLL_LINKAGE Patrol { - Patrol(){patrolling=false;initialPos=int3();patrolRadious=-1;}; + Patrol(){patrolling=false;initialPos=int3();patrolRadius=-1;}; bool patrolling; int3 initialPos; - ui32 patrolRadious; + ui32 patrolRadius; template void serialize(Handler &h, const int version) { h & patrolling; @@ -92,7 +92,7 @@ public: patrolling = false; initialPos = int3(); } - h & patrolRadious; + h & patrolRadius; } } patrol; @@ -134,7 +134,7 @@ public: } //int3 getSightCenter() const; //"center" tile from which the sight distance is calculated - int getSightRadious() const override; //sight distance (should be used if player-owned structure) + int getSightRadius() const override; //sight distance (should be used if player-owned structure) ////////////////////////////////////////////////////////////////////////// int getBoatType() const override; //0 - evil (if a ship can be evil...?), 1 - good, 2 - neutral diff --git a/lib/mapObjects/CGTownInstance.cpp b/lib/mapObjects/CGTownInstance.cpp index 2e13c5ce2..227cf1af3 100644 --- a/lib/mapObjects/CGTownInstance.cpp +++ b/lib/mapObjects/CGTownInstance.cpp @@ -313,7 +313,7 @@ void CGDwelling::blockingDialogAnswered(const CGHeroInstance *hero, ui32 answer) } } -int CGTownInstance::getSightRadious() const //returns sight distance +int CGTownInstance::getSightRadius() const //returns sight distance { if (subID == ETownType::TOWER) { @@ -1109,7 +1109,7 @@ void CGTownInstance::battleFinished(const CGHeroInstance *hero, const BattleResu FoWChange fw; fw.player = hero->tempOwner; fw.mode = 1; - cb->getTilesInRange(fw.tiles, getSightCenter(), getSightRadious(), tempOwner, 1); + cb->getTilesInRange(fw.tiles, getSightCenter(), getSightRadius(), tempOwner, 1); cb->sendAndApply (&fw); } } diff --git a/lib/mapObjects/CGTownInstance.h b/lib/mapObjects/CGTownInstance.h index b636b16a5..d29ea968e 100644 --- a/lib/mapObjects/CGTownInstance.h +++ b/lib/mapObjects/CGTownInstance.h @@ -206,7 +206,7 @@ public: bool passableFor(PlayerColor color) const override; //int3 getSightCenter() const override; //"center" tile from which the sight distance is calculated - int getSightRadious() const override; //returns sight distance + int getSightRadius() const override; //returns sight distance int getBoatType() const override; //0 - evil (if a ship can be evil...?), 1 - good, 2 - neutral void getOutOffsets(std::vector &offsets) const override; //offsets to obj pos when we boat can be placed. Parameter will be cleared int getMarketEfficiency() const override; //=market count diff --git a/lib/mapObjects/CObjectHandler.cpp b/lib/mapObjects/CObjectHandler.cpp index 8b28f36a8..e73a2ecbb 100644 --- a/lib/mapObjects/CObjectHandler.cpp +++ b/lib/mapObjects/CObjectHandler.cpp @@ -243,7 +243,7 @@ int3 CGObjectInstance::getSightCenter() const return visitablePos(); } -int CGObjectInstance::getSightRadious() const +int CGObjectInstance::getSightRadius() const { return 3; } diff --git a/lib/mapObjects/CObjectHandler.h b/lib/mapObjects/CObjectHandler.h index b159482c8..875980f9c 100644 --- a/lib/mapObjects/CObjectHandler.h +++ b/lib/mapObjects/CObjectHandler.h @@ -143,7 +143,7 @@ public: /// Returns true if player can pass through visitable tiles of this object virtual bool passableFor(PlayerColor color) const; /// Range of revealed map around this object, counting from getSightCenter() - virtual int getSightRadious() const; + virtual int getSightRadius() const; /// returns (x,y,0) offset to a visitable tile of object virtual int3 getVisitableOffset() const; /// Called mostly during map randomization to turn random object into a regular one (e.g. "Random Monster" into "Pikeman") diff --git a/lib/mapping/CMap.cpp b/lib/mapping/CMap.cpp index cdf968035..2c02321aa 100644 --- a/lib/mapping/CMap.cpp +++ b/lib/mapping/CMap.cpp @@ -220,7 +220,7 @@ CMapHeader::~CMapHeader() } -CMap::CMap() : checksum(0), grailPos(-1, -1, -1), grailRadious(0), terrain(nullptr) +CMap::CMap() : checksum(0), grailPos(-1, -1, -1), grailRadius(0), terrain(nullptr) { allHeroes.resize(allowedHeroes.size()); allowedAbilities = VLC->heroh->getDefaultAllowedAbilities(); diff --git a/lib/mapping/CMap.h b/lib/mapping/CMap.h index b45b05e21..72c2b9c46 100644 --- a/lib/mapping/CMap.h +++ b/lib/mapping/CMap.h @@ -306,7 +306,7 @@ public: std::vector allowedAbilities; std::list events; int3 grailPos; - int grailRadious; + int grailRadius; //Central lists of items in game. Position of item in the vectors below is their (instance) id. std::vector< ConstTransitivePtr > objects; diff --git a/lib/mapping/MapFormatH3M.cpp b/lib/mapping/MapFormatH3M.cpp index 859abc110..bdf07b9ae 100644 --- a/lib/mapping/MapFormatH3M.cpp +++ b/lib/mapping/MapFormatH3M.cpp @@ -1350,7 +1350,7 @@ void CMapLoaderH3M::readObjects() case Obj::GRAIL: { map->grailPos = objPos; - map->grailRadious = reader.readUInt32(); + map->grailRadius = reader.readUInt32(); continue; } case Obj::RANDOM_DWELLING: //same as castle + level range @@ -1650,8 +1650,8 @@ CGObjectInstance * CMapLoaderH3M::readHero(ObjectInstanceID idToBeGiven, const i nhi->formation = reader.readUInt8(); loadArtifactsOfHero(nhi); - nhi->patrol.patrolRadious = reader.readUInt8(); - if(nhi->patrol.patrolRadious == 0xff) + nhi->patrol.patrolRadius = reader.readUInt8(); + if(nhi->patrol.patrolRadius == 0xff) { nhi->patrol.patrolling = false; } diff --git a/lib/spells/SpellMechanics.h b/lib/spells/SpellMechanics.h index 62b5283f3..0d5305a52 100644 --- a/lib/spells/SpellMechanics.h +++ b/lib/spells/SpellMechanics.h @@ -16,4 +16,4 @@ #include "CDefaultSpellMechanics.h" #include "AdventureSpellMechanics.h" #include "BattleSpellMechanics.h" -#include "CreatureSpellMechanics.h" \ No newline at end of file +#include "CreatureSpellMechanics.h" diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 4136fd35e..a3574e3e6 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -1869,7 +1869,7 @@ bool CGameHandler::moveHero( ObjectInstanceID hid, int3 dst, ui8 teleporting, bo { obj->onHeroLeave(h); } - this->getTilesInRange(tmh.fowRevealed, h->getSightCenter()+(tmh.end-tmh.start), h->getSightRadious(), h->tempOwner, 1); + this->getTilesInRange(tmh.fowRevealed, h->getSightCenter()+(tmh.end-tmh.start), h->getSightRadius(), h->tempOwner, 1); }; auto doMove = [&](TryMoveHero::EResult result, EGuardLook lookForGuards, @@ -2736,7 +2736,7 @@ bool CGameHandler::buildStructure( ObjectInstanceID tid, BuildingID requestedID, FoWChange fw; fw.player = t->tempOwner; fw.mode = 1; - getTilesInRange(fw.tiles, t->getSightCenter(), t->getSightRadious(), t->tempOwner, 1); + getTilesInRange(fw.tiles, t->getSightCenter(), t->getSightRadius(), t->tempOwner, 1); sendAndApply(&fw); if(t->visitingHero) @@ -5822,11 +5822,11 @@ void CGameHandler::changeFogOfWar(int3 center, ui32 radius, PlayerColor player, auto p = gs->getPlayer(player); for (auto h : p->heroes) { - getTilesInRange(observedTiles, h->getSightCenter(), h->getSightRadious(), h->tempOwner, -1); + getTilesInRange(observedTiles, h->getSightCenter(), h->getSightRadius(), h->tempOwner, -1); } for (auto t : p->towns) { - getTilesInRange(observedTiles, t->getSightCenter(), t->getSightRadious(), t->tempOwner, -1); + getTilesInRange(observedTiles, t->getSightCenter(), t->getSightRadius(), t->tempOwner, -1); } for (auto tile : observedTiles) vstd::erase_if_present (tiles, tile); diff --git a/server/CVCMIServer.h b/server/CVCMIServer.h index 01d2a8732..5443d355e 100644 --- a/server/CVCMIServer.h +++ b/server/CVCMIServer.h @@ -97,4 +97,4 @@ public: void startListeningThread(CConnection * pc); }; -extern boost::program_options::variables_map cmdLineOptions; \ No newline at end of file +extern boost::program_options::variables_map cmdLineOptions; diff --git a/server/StdInc.cpp b/server/StdInc.cpp index c8f4ddf05..f500fe6d0 100644 --- a/server/StdInc.cpp +++ b/server/StdInc.cpp @@ -1,2 +1,2 @@ // Creates the precompiled header -#include "StdInc.h" \ No newline at end of file +#include "StdInc.h"