Skip to content

Commit

Permalink
Fix some English typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarod42 committed Feb 15, 2025
1 parent ec4cc71 commit 07af125
Show file tree
Hide file tree
Showing 34 changed files with 90 additions and 90 deletions.
8 changes: 4 additions & 4 deletions src/action/action_attack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/action/action_still.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
}
Expand Down
2 changes: 1 addition & 1 deletion src/ai/ai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
16 changes: 8 additions & 8 deletions src/ai/ai_force.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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];
Expand All @@ -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) {
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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 {
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/ai/ai_plan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down
10 changes: 5 additions & 5 deletions src/include/fov.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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<uint8_t> 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<uint8_t> 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
};

/*----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/include/fow.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class CFogOfWar

uint8_t State { States::cFirstEntry }; /// State of the fog of war calculation process

std::set<uint8_t> VisionFor; /// Visibilty through the fog is generated for this players
std::set<uint8_t> 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

Expand Down
2 changes: 1 addition & 1 deletion src/include/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/include/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/include/missile.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/include/net_lowlevel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/include/net_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/include/netconnect.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/include/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/include/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
**
Expand Down
2 changes: 1 addition & 1 deletion src/include/spell/spell_capture.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
};

Expand Down
2 changes: 1 addition & 1 deletion src/include/spells.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ extern std::vector<std::unique_ptr<SpellType>> SpellTypeTable;
-- Functions
----------------------------------------------------------------------------*/

/// register fonction.
/// register functions.
extern void SpellCclRegister();

/// init spell tables
Expand Down
4 changes: 2 additions & 2 deletions src/include/tile.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@
**
** CMapFieldPlayerInfo::VisCloak[]
**
** Visiblity for cloaking.
** Visibility for cloaking.
**
** CMapFieldPlayerInfo::Radar[]
**
** Visiblity for radar.
** Visibility for radar.
**
** CMapFieldPlayerInfo::RadarJammer[]
**
Expand Down
6 changes: 3 additions & 3 deletions src/include/tileset.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()));
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/include/trigger.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit 07af125

Please sign in to comment.