diff --git a/src/action/action_attack.cpp b/src/action/action_attack.cpp index eb94f9df9a..2ee83ec6dd 100644 --- a/src/action/action_attack.cpp +++ b/src/action/action_attack.cpp @@ -445,7 +445,7 @@ void COrder_Attack::SetAutoTarget(CUnit &unit, CUnit *target) this->SkirmishRange = this->Range; } // Set threshold value only for aggressive units (Prevent to change target) - if (!GameSettings.SimplifiedAutoTargeting && target->IsAgressive()) + if (!GameSettings.SimplifiedAutoTargeting && target->IsAggressive()) { unit.Threshold = 30; } @@ -502,11 +502,11 @@ bool COrder_Attack::AutoSelectTarget(CUnit &unit) && goal->IsVisibleAsGoal(*unit.Player) && CanTarget(*unit.Type, *goal->Type) && (immobile ? InAttackRange(unit, *goal) : (attackedByGoal ? true : InReactRange(unit, *goal))) - && !(unit.UnderAttack && !goal->IsAgressive())) { + && !(unit.UnderAttack && !goal->IsAggressive())) { if (newTarget && newTarget != goal) { /// Do not switch to non aggressive targets while UnderAttack counter is active - if (unit.UnderAttack && !newTarget->IsAgressive()) { + if (unit.UnderAttack && !newTarget->IsAggressive()) { return true; } if (GameSettings.SimplifiedAutoTargeting) { @@ -535,7 +535,7 @@ bool COrder_Attack::AutoSelectTarget(CUnit &unit) if (goal) { this->ClearGoal(); } - if (newTarget && !(unit.UnderAttack && !newTarget->IsAgressive())) { + if (newTarget && !(unit.UnderAttack && !newTarget->IsAggressive())) { SetAutoTarget(unit, newTarget); } else { return false; diff --git a/src/action/action_still.cpp b/src/action/action_still.cpp index f3eceec8a0..f0495ea880 100644 --- a/src/action/action_still.cpp +++ b/src/action/action_still.cpp @@ -417,12 +417,12 @@ void COrder_Still::Execute(CUnit &unit) /* override */ if (!unit.AutoCastSpell.empty()) { this->AutoCastStand(unit); } - if (unit.IsAgressive()) { + if (unit.IsAggressive()) { this->AutoAttackStand(unit); } } else { if (unit.JustMoved) --unit.JustMoved; - if (AutoCast(unit) || (unit.IsAgressive() && AutoAttack(unit)) + if (AutoCast(unit) || (unit.IsAggressive() && AutoAttack(unit)) || AutoRepair(unit) || MoveRandomly(unit)) { } diff --git a/src/ai/ai.cpp b/src/ai/ai.cpp index a88da3a915..bec3eadd21 100644 --- a/src/ai/ai.cpp +++ b/src/ai/ai.cpp @@ -659,7 +659,7 @@ void AiHelpMe(const CUnit *attacker, CUnit &defender) // if brother is idle or attack no-aggressive target and // can attack our attacker then ask for help // FIXME ad support for help from Coward type units - if (aiunit->IsAgressive() && CanTarget(*aiunit->Type, *attacker->Type) + if (aiunit->IsAggressive() && CanTarget(*aiunit->Type, *attacker->Type) && aiunit->CurrentOrder()->GetGoal() != attacker) { bool shouldAttack = aiunit->IsIdle() && aiunit->Threshold == 0; diff --git a/src/ai/ai_force.cpp b/src/ai/ai_force.cpp index 1d9f1de5a3..738a1fb75d 100644 --- a/src/ai/ai_force.cpp +++ b/src/ai/ai_force.cpp @@ -118,7 +118,7 @@ VisitResult EnemyUnitFinder::Visit(TerrainTraversal &terrainTraversal, const Vec } if ((find_type != EAttackFindType::Building || dtype.BoolFlag[BUILDING_INDEX].value) - && (find_type != EAttackFindType::Aggressive || dest->IsAgressive())) { + && (find_type != EAttackFindType::Aggressive || dest->IsAggressive())) { result_unit = dest; return VisitResult::Finished; } else if (result_unit == nullptr) { // if trying to search for buildings or aggressive units specifically, still put the first found unit (even if it doesn't fit those parameters) as the result unit, so that it can be returned if no unit with the specified parameters is found @@ -418,7 +418,7 @@ void AiForce::Attack(const Vec2i &pos) return unit->Type->MoveType == EMovement::Naval && unit->Type->CanAttack; }); const bool isTransporter = ranges::any_of(this->Units, [](const CUnit *unit) { - return unit->Type->CanTransport() && unit->IsAgressive() == false; + return unit->Type->CanTransport() && unit->IsAggressive() == false; }); bool isDefenceForce = false; if (Map.Info.IsPointOnMap(goalPos) == false) { @@ -454,7 +454,7 @@ void AiForce::Attack(const Vec2i &pos) this->State = AiForceAttackingState::Attacking; } // Send all units in the force to enemy. - const auto leaderIt = ranges::find_if(this->Units, [](const CUnit *unit) { return unit->IsAgressive(); }); + const auto leaderIt = ranges::find_if(this->Units, [](const CUnit *unit) { return unit->IsAggressive(); }); CUnit *leader = leaderIt != this->Units.end() ? *leaderIt : nullptr; for (size_t i = 0; i != this->Units.size(); ++i) { CUnit *const unit = this->Units[i]; @@ -463,7 +463,7 @@ void AiForce::Attack(const Vec2i &pos) const int delay = i / 5; // To avoid lot of CPU consumption, send them with a small time difference. unit->Wait = delay; - if (unit->IsAgressive()) { + if (unit->IsAggressive()) { CommandAttack(*unit, this->GoalPos, nullptr, EFlushMode::On); } else { if (leader) { @@ -906,7 +906,7 @@ void AiForce::Update() return; } CUnit *leader = nullptr; - if (auto it = ranges::find_if(Units, &CUnit::IsAgressive); it != Units.end()) { + if (auto it = ranges::find_if(Units, &CUnit::IsAggressive); it != Units.end()) { leader = *it; } @@ -948,7 +948,7 @@ void AiForce::Update() const int delay = i / 5; // To avoid lot of CPU consumption, send them with a small time difference. aiunit.Wait = delay; - if (aiunit.IsAgressive()) { + if (aiunit.IsAggressive()) { CommandAttack(aiunit, this->GoalPos, nullptr, EFlushMode::On); } else { if (leader) { @@ -1000,7 +1000,7 @@ void AiForce::Update() aiunit.Wait = delay; if (leader) { - if (aiunit.IsAgressive()) { + if (aiunit.IsAggressive()) { if (State == AiForceAttackingState::Attacking) { CommandAttack(aiunit, leader->tilePos, nullptr, EFlushMode::On); } else { @@ -1010,7 +1010,7 @@ void AiForce::Update() CommandDefend(aiunit, *leader, EFlushMode::On); } } else { - if (aiunit.IsAgressive()) { + if (aiunit.IsAggressive()) { CommandAttack(aiunit, this->GoalPos, nullptr, EFlushMode::On); } else { CommandMove(aiunit, this->GoalPos, EFlushMode::On); diff --git a/src/ai/ai_plan.cpp b/src/ai/ai_plan.cpp index d40c89e667..54bc0bc0e8 100644 --- a/src/ai/ai_plan.cpp +++ b/src/ai/ai_plan.cpp @@ -78,7 +78,7 @@ CUnit *EnemyOnMapTile(const CUnit &source, const Vec2i &pos) || unit->Variable[INVISIBLE_INDEX].Value // || (!UnitVisible(unit, source->Player)) || unit->CurrentAction() == UnitAction::Die - || (unit->Type->MoveType == EMovement::Fly && unit->IsAgressive() == false) + || (unit->Type->MoveType == EMovement::Fly && unit->IsAggressive() == false) || unit->MapDistanceTo(pos) != 0 || !CanTarget(*source.Type, type) || !source.Player->IsEnemy(*unit) // a friend or neutral ); diff --git a/src/include/fov.h b/src/include/fov.h index 3ccd0aab97..f28e198889 100644 --- a/src/include/fov.h +++ b/src/include/fov.h @@ -76,10 +76,10 @@ class CFieldOfView /// Calc whole simple radial field of view void ProceedSimpleRadial(const CPlayer &player, const Vec2i &pos, const int16_t w, const int16_t h, int16_t range, MapMarkerFunc *marker) const; - /// Calc whole chadow casting field of view + /// Calc whole shadow casting field of view void ProceedShadowCasting(const Vec2i &spectatorPos, const uint16_t width, const uint16_t height, const uint16_t range); /// Calc field of view for set of lines along x or y. - /// Used for calc part of FoV for assymetric (width != height) spectators. + /// Used for calc part of FoV for asymmetric (width != height) spectators. void ProceedRaysCast(const uint8_t octant, const Vec2i &origin, const uint16_t width, const uint16_t range); /// Calc shadow casting field of view for single octant void RefreshOctant(const uint8_t octant, const Vec2i &origin, const uint16_t range); @@ -123,9 +123,9 @@ class CFieldOfView const CUnit *Unit {nullptr}; /// Pointer to unit to calculate FoV for MapMarkerFunc *map_setFoV {nullptr}; /// Pointer to external function for setting tiles visibilty - std::vector MarkedTilesCache; /// To prevent multiple calls of map_setFoV for single tile (for tiles on the vertical, - /// horizontal and diagonal lines it calls twise) we use cache table to - /// count already marked tiles + std::vector MarkedTilesCache; /// To prevent multiple calls of map_setFoV for single tile + /// (for tiles on the vertical, horizontal and diagonal lines it calls twice) + /// we use cache table to count already marked tiles }; /*---------------------------------------------------------------------------- diff --git a/src/include/fow.h b/src/include/fow.h index 80f7249523..1ecaf61569 100644 --- a/src/include/fow.h +++ b/src/include/fow.h @@ -142,7 +142,7 @@ class CFogOfWar uint8_t State { States::cFirstEntry }; /// State of the fog of war calculation process - std::set VisionFor; /// Visibilty through the fog is generated for this players + std::set VisionFor; /// Visibility through the fog is generated for this players /// ThisPlayer and his allies in normal games /// Any set of players for observers and in the replays diff --git a/src/include/interface.h b/src/include/interface.h index b9425bc2ec..1a210eb577 100644 --- a/src/include/interface.h +++ b/src/include/interface.h @@ -75,7 +75,7 @@ enum class ButtonCmd { Train, /// order train StandGround, /// order stand ground Return, /// order return goods - Research, /// order reseach + Research, /// order research UpgradeTo, /// order upgrade Cancel, /// cancel CancelUpgrade, /// cancel upgrade diff --git a/src/include/map.h b/src/include/map.h index 4deff2d08c..ecf455564f 100644 --- a/src/include/map.h +++ b/src/include/map.h @@ -183,11 +183,11 @@ class CMap /// Remove wood, rock or wall from the map and update nearby unit's vision if needed void ClearTile(const Vec2i &tilePos); - /// convert map pixelpos coordonates into tilepos + /// convert map pixelpos coordinates into tilepos Vec2i MapPixelPosToTilePos(const PixelPos &mapPos) const; - /// convert tilepos coordonates into map pixel pos (take the top left of the tile) + /// convert tilepos coordinates into map pixel pos (take the top left of the tile) PixelPos TilePosToMapPixelPos_TopLeft(const Vec2i &tilePos) const; - /// convert tilepos coordonates into map pixel pos (take the center of the tile) + /// convert tilepos coordinates into map pixel pos (take the center of the tile) PixelPos TilePosToMapPixelPos_Center(const Vec2i &tilePos) const; /// Mark a tile as seen by the player. @@ -311,13 +311,13 @@ extern void UpdateFogOfWarChange(); // in map_radar.c // -/// Mark a tile as radar visible, or incrase radar vision +/// Mark a tile as radar visible, or increase radar vision extern MapMarkerFunc MapMarkTileRadar; /// Unmark a tile as radar visible, decrease is visible by other radar extern MapMarkerFunc MapUnmarkTileRadar; -/// Mark a tile as radar jammed, or incrase radar jamming'ness +/// Mark a tile as radar jammed, or increase radar jamming'ness extern MapMarkerFunc MapMarkTileRadarJammer; /// Unmark a tile as jammed, decrease is jamming'ness diff --git a/src/include/missile.h b/src/include/missile.h index 0b494b4647..e810bf91cc 100644 --- a/src/include/missile.h +++ b/src/include/missile.h @@ -146,7 +146,7 @@ ** field where the missile hits. A value of 2 would mean that ** the damage for that particular missile would be dealt for a range ** of 1 around the impact spot. All fields that aren't the center -** get only 1/SpashFactor of the damage. Fields 2 away get +** get only 1/SplashFactor of the damage. Fields 2 away get ** 1/(SplashFactor*2), and following... ** ** MissileType::SplashFactor @@ -385,7 +385,7 @@ class MissileType MissileClass Class = MissileClass::Nothing; /// missile class int NumBounces = 0; /// number of bounces - int ParabolCoefficient = 2048; /// parabol coefficient in parabolic missile + int ParabolaCoefficient = 2048; /// parabola coefficient in parabolic missile int StartDelay = 0; /// missile start delay int Sleep = 0; /// missile sleep int Speed = 0; /// missile speed diff --git a/src/include/net_lowlevel.h b/src/include/net_lowlevel.h index 66066b8d42..4df2bce7f9 100644 --- a/src/include/net_lowlevel.h +++ b/src/include/net_lowlevel.h @@ -106,9 +106,9 @@ class SocketSet -- Functions ----------------------------------------------------------------------------*/ -/// Hardware dependend network init. +/// Hardware dependent network init. extern int NetInit(); -/// Hardware dependend network exit. +/// Hardware dependent network exit. extern void NetExit(); /// Resolve host in name or or colon dot notation. diff --git a/src/include/net_message.h b/src/include/net_message.h index 030a3a8eae..13df47d0b9 100644 --- a/src/include/net_message.h +++ b/src/include/net_message.h @@ -405,7 +405,7 @@ enum _message_type_ { MessageExtendedCommand, /// Command is the next byte - // ATTN: __MUST__ be last due to spellid encoding!!! + // ATTN: __MUST__ be last due to spell id encoding!!! MessageCommandSpellCast /// Unit command spell cast }; @@ -415,7 +415,7 @@ enum _message_type_ { enum _extended_message_type_ { ExtendedMessageDiplomacy, /// Change diplomacy ExtendedMessageSharedVision, /// Change shared vision - ExtendedMessageAutoTargetingDB, /// Change Auto targetting algorithm. Used for debug purposes + ExtendedMessageAutoTargetingDB, /// Change Auto targeting algorithm. Used for debug purposes ExtendedMessageFieldOfViewDB, /// Change field of view type (shadow casting or radial). Used for debug purposes ExtendedMessageMapFieldsOpacityDB, /// Change opaque flag for forest, rocks or walls. Used for debug purposes ExtendedMessageRevealMapDB, /// Change map reveal mode. Used for debug purposes diff --git a/src/include/netconnect.h b/src/include/netconnect.h index 70a42c9e21..40c6356a9f 100644 --- a/src/include/netconnect.h +++ b/src/include/netconnect.h @@ -104,7 +104,7 @@ extern std::string NetworkMapFragmentName; /// Name of the map currently loading extern CServerSetup ServerSetupState; /// Network menu: Multiplayer Server Menu selections state extern CServerSetup LocalSetupState; /// Network menu: Multiplayer Client Menu selections local state -extern bool NoRandomPlacementMultiplayer; /// Disable the random placement of players in muliplayer mode +extern bool NoRandomPlacementMultiplayer; /// Disable the random placement of players in multiplayer mode /*---------------------------------------------------------------------------- -- Functions @@ -122,7 +122,7 @@ extern bool NetworkParseSetupEvent(const unsigned char *buf, int size, const CHo extern int NetworkSetupServerAddress(const std::string &serveraddr, int port); /// Menu: Setup the server IP extern void NetworkProcessClientRequest(); /// Menu Loop: Send out client request messages extern void NetworkProcessServerRequest(); /// Menu Loop: Send out server request messages -extern void NetworkServerResyncClients(); /// Menu Loop: Server: Mark clients state to send stateinfo message +extern void NetworkServerResyncClients(); /// Menu Loop: Server: Mark clients state to send state info message extern void NetworkDetachFromServer(); /// Menu Loop: Client: Send GoodBye to the server and detach extern void NetworkSendICMessage(CUDPSocket &socket, const CHost &host, const CInitMessage_Header &msg); diff --git a/src/include/player.h b/src/include/player.h index 85b6e6e4ac..ee0be66b62 100644 --- a/src/include/player.h +++ b/src/include/player.h @@ -108,7 +108,7 @@ class CPlayer static inline RevealTypes RevelationFor { RevealTypes::cNoRevelation }; /// type of revelation (when player lost their last main facility) public: - /// Check if relevation enabled + /// Check if revelation enabled static const bool IsRevelationEnabled() { // By default there is no revelation. Can be changed in lua-script diff --git a/src/include/settings.h b/src/include/settings.h index 107165b62b..d50e4cfb44 100644 --- a/src/include/settings.h +++ b/src/include/settings.h @@ -92,7 +92,7 @@ constexpr int8_t SettingsPresetMapDefault = -1; /// Special: Use map supplied ** ** #PlayerPerson ** -** This player is contolled by a person. This can be the player +** This player is controlled by a person. This can be the player ** sitting on the local computer or player playing over the ** network. ** diff --git a/src/include/spell/spell_capture.h b/src/include/spell/spell_capture.h index 4e0de0a12d..6b019f2e34 100644 --- a/src/include/spell/spell_capture.h +++ b/src/include/spell/spell_capture.h @@ -48,7 +48,7 @@ class Spell_Capture : public SpellActionType private: bool SacrificeEnable = false; /// true if the caster dies after casting. bool JoinToAIForce = false; /// if true, captured unit is joined into caster's AI force, if available - int Damage = 0; /// damage the spell does if unable to caputre + int Damage = 0; /// damage the spell does if unable to capture int DamagePercent = 0; /// percent the target must be damaged for a capture to succeed. }; diff --git a/src/include/spells.h b/src/include/spells.h index 26defa4349..d40a617c5e 100644 --- a/src/include/spells.h +++ b/src/include/spells.h @@ -228,7 +228,7 @@ extern std::vector> SpellTypeTable; -- Functions ----------------------------------------------------------------------------*/ -/// register fonction. +/// register functions. extern void SpellCclRegister(); /// init spell tables diff --git a/src/include/tile.h b/src/include/tile.h index 8f213c9d54..7007ad2b1f 100644 --- a/src/include/tile.h +++ b/src/include/tile.h @@ -55,11 +55,11 @@ ** ** CMapFieldPlayerInfo::VisCloak[] ** -** Visiblity for cloaking. +** Visibility for cloaking. ** ** CMapFieldPlayerInfo::Radar[] ** -** Visiblity for radar. +** Visibility for radar. ** ** CMapFieldPlayerInfo::RadarJammer[] ** diff --git a/src/include/tileset.h b/src/include/tileset.h index ebd9cae2d5..8d471bdd65 100644 --- a/src/include/tileset.h +++ b/src/include/tileset.h @@ -97,7 +97,7 @@ constexpr tile_index ExtendedTilesetBeginIdx {0x1010}; /// the extended tiles in ** mainly used for the FOW implementation of the seen woods/rocks ** ** @todo I think this can be removed, we can use the flags? -** I'm not sure, if we have seen and real time to considere. +** I'm not sure, if we have seen and real time to consider. */ enum class ETileType : unsigned char { Unknown, /// Unknown tile type @@ -211,7 +211,7 @@ class CTileset terrain_typeIdx getOrAddSolidTileIndexByName(const std::string &name); - /// FIXME: Check if it realy needed + /// FIXME: Check if it really needed terrain_typeIdx addDecoTerrainType() { return getOrAddSolidTileIndexByName(std::to_string(solidTerrainTypes.size())); @@ -287,7 +287,7 @@ GenerateExtendedTileset( Second "terrain-name" in the slot definition is for mixed type. list-of-flags-for-all-tiles-of-this-slot: - comma separated list of flags wihich are common for all tiles in this slot + comma separated list of flags which are common for all tiles in this slot dst: single argument (number or table) at position 1. diff --git a/src/include/trigger.h b/src/include/trigger.h index d0a8dd5849..c269c24d22 100644 --- a/src/include/trigger.h +++ b/src/include/trigger.h @@ -59,7 +59,7 @@ class CTimer }; /** -** Data to referer game info when game running. +** Data to refer game info when game running. */ struct TriggerDataType { CUnit *Attacker = nullptr; /// Unit which send the missile. diff --git a/src/include/ui.h b/src/include/ui.h index 47d5871500..ad4555d6f6 100644 --- a/src/include/ui.h +++ b/src/include/ui.h @@ -150,7 +150,7 @@ class CUIButton enum ViewportModeType { VIEWPORT_SINGLE = 0, /// Old single viewport VIEWPORT_SPLIT_HORIZ, /// Two viewports split horizontal - VIEWPORT_SPLIT_HORIZ3, /// Three viewports split horiontal + VIEWPORT_SPLIT_HORIZ3, /// Three viewports split horizontal VIEWPORT_SPLIT_VERT, /// Two viewports split vertical VIEWPORT_QUAD, /// Four viewports split symmetric NUM_VIEWPORT_MODES /// Number of different viewports. @@ -303,7 +303,7 @@ class CPieMenu CPieMenu() = default; std::shared_ptr G; /// Optional background image - int MouseButton = NoButton; /// Which mouse button pops up the piemenu, deactivate with NoButton + int MouseButton = NoButton; /// Which mouse button pops up the pie-menu, deactivate with NoButton int X[9]{}; /// X position of the pies int Y[9]{}; /// Y position of the pies @@ -369,9 +369,9 @@ class CUserInterface bool KeyScroll = false; /// Enable keyboard scrolling /// Key Scroll Speed int KeyScrollSpeed = 1; - /// Mouse Scroll Speed (screenpixels per mousepixel) + /// Mouse Scroll Speed (screen-pixels per mouse-pixel) int MouseScrollSpeed = 1; - /// Middle-Mouse Scroll Speed (screenpixels per mousepixel) + /// Middle-Mouse Scroll Speed (screen-pixels per mouse-pixel) int MouseScrollSpeedDefault = 0; /// Middle-Mouse Scroll Speed with Control pressed int MouseScrollSpeedControl = 0; @@ -399,7 +399,7 @@ class CUserInterface CUIButton *SingleTrainingButton = nullptr; /// Button for single training std::string SingleTrainingText; /// Text for single training - CFont *SingleTrainingFont = 0; /// Font for single traning + CFont *SingleTrainingFont = 0; /// Font for single training int SingleTrainingTextX = 0; /// X text position single training int SingleTrainingTextY = 0; /// Y text position single training @@ -495,7 +495,7 @@ class CUserInterface /// Is in gamesounds? /// SoundConfig PlacementError; /// played on placements errors /// SoundConfig PlacementSuccess; /// played on placements success - /// SoundConfig Click; /// click noice used often + /// SoundConfig Click; /// click noise used often std::shared_ptr VictoryBackgroundG; /// Victory background graphic std::shared_ptr DefeatBackgroundG; /// Defeat background graphic diff --git a/src/include/ui/popup.h b/src/include/ui/popup.h index bc2526b754..aa9616c05a 100644 --- a/src/include/ui/popup.h +++ b/src/include/ui/popup.h @@ -127,7 +127,7 @@ class CPopupContentTypeButtonInfo : public CPopupContentType private: EPopupButtonInfo InfoType = EPopupButtonInfo::Hint; /// Type of information to show. - unsigned int MaxWidth = 0; /// Maximum width of multilined information. + unsigned int MaxWidth = 0; /// Maximum width of multi-lined information. CFont *Font = nullptr; /// Font to use. }; @@ -151,7 +151,7 @@ class CPopupContentTypeText : public CPopupContentType private: std::string Text; /// Text to display - unsigned int MaxWidth = 0; /// Maximum width of multilined text. + unsigned int MaxWidth = 0; /// Maximum width of multi-lined text. CFont *Font = nullptr; /// Font to use. }; diff --git a/src/include/unit.h b/src/include/unit.h index 5112fa25f4..f5980fc1ee 100644 --- a/src/include/unit.h +++ b/src/include/unit.h @@ -187,7 +187,7 @@ class CUnit bool CanStoreOrder(COrder *order); // Cowards and invisible units don't attack unless ordered. - bool IsAgressive() const + bool IsAggressive() const { return (Type->BoolFlag[CANATTACK_INDEX].value && !Type->BoolFlag[COWARD_INDEX].value && Variable[INVISIBLE_INDEX].Value == 0); @@ -196,7 +196,7 @@ class CUnit /// Returns true, if unit is directly seen by an allied unit. bool IsVisible(const CPlayer &player) const; - bool IsInvisibile(const CPlayer &player) const + bool IsInvisible(const CPlayer &player) const { return (&player != Player && Variable[INVISIBLE_INDEX].Value > 0 && !Player->HasSharedVisionWith(player)); @@ -228,7 +228,7 @@ class CUnit bool IsVisibleAsGoal(const CPlayer &player) const { // Invisibility - if (IsInvisibile(player)) { + if (IsInvisible(player)) { return false; } // Don't attack revealers @@ -255,7 +255,7 @@ class CUnit */ bool IsVisibleOnMap(const CPlayer &player) const { - return IsAliveOnMap() && !IsInvisibile(player) && IsVisible(player); + return IsAliveOnMap() && !IsInvisible(player) && IsVisible(player); } /// Returns true if unit is visible on minimap. Only for ThisPlayer. diff --git a/src/include/unit_find.h b/src/include/unit_find.h index e21ad92e18..8b7a411630 100644 --- a/src/include/unit_find.h +++ b/src/include/unit_find.h @@ -149,10 +149,10 @@ class IsSameMovementType : public CUnitFilter const unsigned Mask; }; -class IsAggresiveUnit : public CUnitFilter +class IsAggressiveUnit : public CUnitFilter { public: - bool operator()(const CUnit *unit) const { return unit->IsAgressive(); } + bool operator()(const CUnit *unit) const { return unit->IsAggressive(); } }; class OutOfMinRange : public CUnitFilter @@ -332,7 +332,7 @@ extern CUnit *FindDeposit(const CUnit &unit, int range, int resource); /// Find the next idle worker extern CUnit *FindIdleWorker(const CPlayer &player, const CUnit *last); -/// Find the neareast piece of terrain with specific flags. +/// Find the nearest piece of terrain with specific flags. extern std::optional FindTerrainType(int movemask, int resmask, int range, const CPlayer &player, const Vec2i &startPos); diff --git a/src/include/unittype.h b/src/include/unittype.h index c56f1f62a1..1389df5e54 100644 --- a/src/include/unittype.h +++ b/src/include/unittype.h @@ -174,7 +174,7 @@ enum { SIDEATTACK_INDEX, /// Unit turns sideways to attack (like e.g. a galley would before firing a broadside) SURROUND_ATTACK_INDEX, /// Unit doesn't turn towards the attack (it can shoot in any direction) SKIRMISHER_INDEX, - ALWAYSTHREAT_INDEX, /// Unit always considered as threat for auto targeting algorihm, useful for unit without main attack ability, but which can cast spells (f.e. defiler in SC:BW) + ALWAYSTHREAT_INDEX, /// Unit always considered as threat for auto targeting algorithm, useful for unit without main attack ability, but which can cast spells (f.e. defiler in SC:BW) ELEVATED_INDEX, /// Unit is elevated and can see over opaque tiles placed in the same ground level with the unit. NOFRIENDLYFIRE_INDEX, /// Unit accepts friendly fire for splash attacks MAINFACILITY_INDEX, /// Unit is a main building (Town Hall f. ex.) diff --git a/src/include/version.h b/src/include/version.h index b95393630a..4734a4edca 100644 --- a/src/include/version.h +++ b/src/include/version.h @@ -38,4 +38,4 @@ #define LICENSE "GPL v2" /// Copyright -#define COPYRIGHT "Copyright (c) 1998-2020 by The Stratagus Project" +#define COPYRIGHT "Copyright (c) 1998-2025 by The Stratagus Project" diff --git a/src/include/video.h b/src/include/video.h index 9be74a0a41..49ac87ceaa 100644 --- a/src/include/video.h +++ b/src/include/video.h @@ -82,7 +82,7 @@ class PixelModifier { public: /// This one returns srcRGB+A(modulated) only if srcA is present. Otherwise returns dstRGBA. - /// Used to copy (without alpha modulating) those pixels which has alpha chanel values + /// Used to copy (without alpha modulating) those pixels which has alpha channel values static uint32_t CopyWithSrcAlphaKey(const uint32_t srcPixel, const uint32_t dstPixel, const uint32_t reqAlpha) { uint32_t srcAlpha = (srcPixel >> ASHIFT) & 0xFF; @@ -441,7 +441,7 @@ extern void VideoCclRegister(); /// initialize the image loaders part extern void InitImageLoaders(); -/// deinitialize the image loaders +/// de-initialize the image loaders extern void DeInitImageLoaders(); /// initialize the video part diff --git a/src/include/viewport.h b/src/include/viewport.h index 53cff52c1b..e4265dc537 100644 --- a/src/include/viewport.h +++ b/src/include/viewport.h @@ -80,9 +80,9 @@ class CViewport /// convert screen coordinate into tilepos Vec2i ScreenToTilePos(const PixelPos &screenPixelPos) const; - /// convert tilepos coordonates into screen (take the top left of the tile) + /// convert tilepos coordinates into screen (take the top left of the tile) PixelPos TilePosToScreen_TopLeft(const Vec2i &tilePos) const; - /// convert tilepos coordonates into screen (take the center of the tile) + /// convert tilepos coordinates into screen (take the center of the tile) PixelPos TilePosToScreen_Center(const Vec2i &tilePos) const; SDL_Surface* GetFogSurface() { @@ -133,7 +133,7 @@ class CViewport private: /// Set the current map view to x,y(upper,left corner) void Set(const PixelPos &mapPixelPos); - /// Draw the map grid for dubug purposes + /// Draw the map grid for debug purposes void DrawMapGridInViewport() const; /** Draw the map background. * The template parameter graphicalTileIsLogicalTile selects the specialization. diff --git a/src/missile/missile_parabolic.cpp b/src/missile/missile_parabolic.cpp index 908e173d96..d26f14d852 100644 --- a/src/missile/missile_parabolic.cpp +++ b/src/missile/missile_parabolic.cpp @@ -53,7 +53,7 @@ static bool ParabolicMissile(Missile &missile) { // Should be initialised by an other method (computed with distance...) - const double k = -missile.Type->ParabolCoefficient; // Coefficient of the parabol. + const double k = -missile.Type->ParabolaCoefficient; // Coefficient of the parabola. const double zprojToX = 4.0; // Projection of Z axis on axis X. const double zprojToY = 1024.0; // Projection of Z axis on axis Y. double z; // should be missile.Z later. diff --git a/src/missile/script_missile.cpp b/src/missile/script_missile.cpp index 0dc17ced72..314c1d6763 100644 --- a/src/missile/script_missile.cpp +++ b/src/missile/script_missile.cpp @@ -132,8 +132,8 @@ void MissileType::Load(lua_State *l) } } else if (value == "NumBounces") { this->NumBounces = LuaToNumber(l, -1); - } else if (value == "ParabolCoefficient") { - this->ParabolCoefficient = LuaToNumber(l, -1); + } else if (value == "ParabolCoefficient" || value == "ParabolaCoefficient") { + this->ParabolaCoefficient = LuaToNumber(l, -1); } else if (value == "Delay") { this->StartDelay = LuaToNumber(l, -1); } else if (value == "Sleep") { diff --git a/src/network/net_lowlevel.cpp b/src/network/net_lowlevel.cpp index 3ea5233265..184aa3b664 100644 --- a/src/network/net_lowlevel.cpp +++ b/src/network/net_lowlevel.cpp @@ -74,7 +74,7 @@ using sendbuftype = const void *; #ifdef USE_WINSOCK // { /** -** Hardware dependend network init. +** Hardware dependent network init. */ int NetInit() { @@ -89,7 +89,7 @@ int NetInit() } /** -** Hardware dependend network exit. +** Hardware dependent network exit. */ void NetExit() { @@ -127,7 +127,7 @@ void NetCloseTCP(Socket sockfd) #if !defined(USE_WINSOCK) // { /** -** Hardware dependend network init. +** Hardware dependent network init. */ int NetInit() { @@ -135,7 +135,7 @@ int NetInit() } /** -** Hardware dependend network exit. +** Hardware dependent network exit. */ void NetExit() { diff --git a/src/pathfinder/astar.cpp b/src/pathfinder/astar.cpp index 570026f300..20a5e12fa6 100644 --- a/src/pathfinder/astar.cpp +++ b/src/pathfinder/astar.cpp @@ -482,7 +482,7 @@ static inline int AStarAddNode(const Vec2i &pos, int64_t costs) /** ** Change the cost associated to an open node. -** Can be further optimised knowing that the new cost MUST BE LOWER +** Can be further optimized knowing that the new cost MUST BE LOWER ** than the old one. */ static void AStarReplaceNode(int pos) @@ -576,7 +576,7 @@ static int CostMoveToCallBack_Default(unsigned int index, const CUnit &unit) #endif return -1; } - if (goal->Player->IsEnemy(unit) && unit.IsAgressive() && CanTarget(*unit.Type, *goal->Type) + if (goal->Player->IsEnemy(unit) && unit.IsAggressive() && CanTarget(*unit.Type, *goal->Type) && goal->Variable[UNHOLYARMOR_INDEX].Value == 0 && goal->IsVisibleAsGoal(*unit.Player)) { cost += 2 * AStarMovingUnitCrossingCost; } else { @@ -1105,7 +1105,7 @@ int AStarFindPath(const Vec2i &startPos, const Vec2i &goalPosIn, int gw, int gh, eo = o + Heading2X[i] + Heading2O[i]; if (eo < 0 || eo >= CostMoveToCache.size()) { - // unaccessible tile + // inaccessible tile continue; } diff --git a/src/unit/unit.cpp b/src/unit/unit.cpp index 31f4c87617..77abf4bb16 100644 --- a/src/unit/unit.cpp +++ b/src/unit/unit.cpp @@ -214,7 +214,7 @@ ** Used to keep track of visible units on the map, it counts the ** Number of seen tiles for each player. This is only modified ** in UnitsMarkSeen and UnitsUnmarkSeen, from fow. -** We keep track of visilibty for each player, and combine with +** We keep track of visibility for each player, and combine with ** Shared vision ONLY when querying and such. ** ** CUnit::SeenByPlayer @@ -1566,7 +1566,7 @@ void UnitGoesOutOfFog(CUnit &unit, const CPlayer &player) } /** -** Recalculates a units visiblity count. This happens really often, +** Recalculates a units visibility count. This happens really often, ** Like every time a unit moves. It's really fast though, since we ** have per-tile counts. ** @@ -1677,7 +1677,7 @@ bool CUnit::IsVisible(const CPlayer &player) const bool CUnit::IsVisibleOnMinimap() const { // Invisible units. - if (IsInvisibile(*ThisPlayer)) { + if (IsInvisible(*ThisPlayer)) { return false; } if (IsVisible(*ThisPlayer) || ReplayRevealMap || IsVisibleOnRadar(*ThisPlayer) @@ -1723,7 +1723,7 @@ bool CUnit::IsVisibleInViewport(const CViewport &vp) const } // Those are never ever visible. - if (IsInvisibile(*ThisPlayer)) { + if (IsInvisible(*ThisPlayer)) { return false; } @@ -1877,7 +1877,7 @@ static void ChangePlayerOwner(CPlayer &oldplayer, CPlayer &newplayer) /** ** Rescue units. ** -** Look through all rescueable players, if they could be rescued. +** Look through all rescuable players, if they could be rescued. */ void RescueUnits() { @@ -2447,7 +2447,7 @@ int ThreatCalculate(const CUnit &unit, const CUnit &dest) int cost = 0; // Buildings, non-aggressive (except workers) and invincible units have the lowest priority - if ((dest.IsAgressive() == false && !dest.Type->BoolFlag[HARVESTER_INDEX].value) || dest.Variable[UNHOLYARMOR_INDEX].Value > 0 + if ((dest.IsAggressive() == false && !dest.Type->BoolFlag[HARVESTER_INDEX].value) || dest.Variable[UNHOLYARMOR_INDEX].Value > 0 || dest.Type->BoolFlag[INDESTRUCTIBLE_INDEX].value) { if (dest.Type->CanMove() == false) { return INT_MAX; @@ -2542,7 +2542,7 @@ int TargetPriorityCalculate(const CUnit &attacker, const CUnit &dest) // To reduce melee units roaming when a lot of them fight in small areas // we do full priority calculations only for easy reachable targets, or for targets which attacks this unit. - // For other targets we dramaticaly reduce priority and calc only attacked by/threat factor, distance and health + // For other targets we dramatically reduce priority and calc only attacked by/threat factor, distance and health const int maxDistance = attackRange > 1 ? reactionRange : (reactionRange * 3) >> 1 /* x1.5 */; const bool isFarAwayTarget = !(priority & AT_ATTACKED_BY_FACTOR) && (pathLength + 1 > maxDistance); @@ -2845,7 +2845,7 @@ static void HitUnit_RunAway(CUnit &target, const CUnit &attacker) { const Vec2i pos = GetRndPosInDirection(target.tilePos, attacker, true, 5, 3); - if (target.IsAgressive()) { + if (target.IsAggressive()) { CommandAttack(target, pos, nullptr, EFlushMode::Off); /// Attack-move to pos } else { CommandMove(target, pos, EFlushMode::Off); /// Run away to pos @@ -2870,7 +2870,7 @@ static void HitUnit_AttackBack(CUnit &attacker, CUnit &target) } return; } - if (order.HasGoal() && order.GetGoal()->IsAgressive()) { + if (order.HasGoal() && order.GetGoal()->IsAggressive()) { return; } } else { @@ -3053,7 +3053,7 @@ void HitUnit(CUnit *attacker, CUnit &target, int damage, const Missile *missile) if (target.CanMove() && target.CurrentAction() == UnitAction::Still && (!CanTarget(*target.Type, *attacker->Type) - || !target.IsAgressive() + || !target.IsAggressive() || (attacker->Type->BoolFlag[PERMANENTCLOAK_INDEX].value && !(attacker->IsVisible(*target.Player) || attacker->IsVisibleOnRadar(*target.Player)))) && !(target.BoardCount && target.Type->BoolFlag[ATTACKFROMTRANSPORTER_INDEX].value == true)) { @@ -3072,7 +3072,7 @@ void HitUnit(CUnit *attacker, CUnit &target, int damage, const Missile *missile) } } - if (target.Threshold == 0 && target.IsAgressive() && target.CanMove() && !target.ReCast) { + if (target.Threshold == 0 && target.IsAggressive() && target.CanMove() && !target.ReCast) { // Attack units in range (which or the attacker?) // Don't bother unit if it casting repeatable spell HitUnit_AttackBack(*attacker, target); diff --git a/src/unit/unit_find.cpp b/src/unit/unit_find.cpp index 27e1eb0af3..14902c3ae9 100644 --- a/src/unit/unit_find.cpp +++ b/src/unit/unit_find.cpp @@ -730,7 +730,7 @@ class BestTargetFinder return INT_MAX; } - if (dtype.MoveType == EMovement::Fly && dest->IsAgressive() == false) { + if (dtype.MoveType == EMovement::Fly && dest->IsAggressive() == false) { return INT_MAX / 2; }