Skip to content

Commit

Permalink
Fix EditorConfig warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Belonit committed Oct 1, 2024
1 parent 3afa1ec commit 4de837d
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ reviews:
auto_review:
enabled: false
chat:
auto_reply: false
auto_reply: false
2 changes: 1 addition & 1 deletion docs/User-Interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ IngameScore.LoseTheme= ; Soundtrack theme ID
- Default `Offset.ShieldDelta` for `InfoType=Shield` is `0,-10`, `0,0` for others.
- Default `Shape.Spacing` for buildings is `4,-2`, `4,0` for others.
- `ValueScaleDivisor` can be used to adjust scale of displayed values. Both the current & maximum value will be divided by the integer number given, if higher than 1.

In `rulesmd.ini`:
```ini
[DigitalDisplayTypes]
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/QuickSave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void QuickSaveCommandClass::Execute(WWKey eInput) const
else
Phobos::CustomGameSaveDescription = ScenarioClass::Instance->Name;
Phobos::CustomGameSaveDescription += L" - ";
Phobos::CustomGameSaveDescription += GeneralUtils::LoadStringUnlessMissing("TXT_QUICKSAVE_SUFFIX", L"Quicksaved");
Phobos::CustomGameSaveDescription += GeneralUtils::LoadStringUnlessMissing("TXT_QUICKSAVE_SUFFIX", L"Quicksaved");
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/Ext/Building/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ bool BuildingExt::ExtData::HandleInfiltrate(HouseClass* pInfiltratorHouse,int mo
int idx = this->TypeExtData->SpyEffect_VictimSuperWeapon;
if (idx >= 0)
launchTheSWHere(pVictimHouse->Supers.Items[idx], pVictimHouse);

idx = this->TypeExtData->SpyEffect_InfiltratorSuperWeapon;
if (idx >= 0)
launchTheSWHere(pInfiltratorHouse->Supers.Items[idx], pInfiltratorHouse);
Expand Down
20 changes: 11 additions & 9 deletions src/Ext/BuildingType/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,16 @@ DEFINE_HOOK(0x6D528A, TacticalClass_DrawPlacement_PlacementPreview, 0x6)
}


Point2D point;
{
CoordStruct offset = pTypeExt->PlacementPreview_Offset;
int nHeight = offset.Z + pCell->GetFloorHeight({ 0, 0 });
Point2D nPoint = TacticalClass::Instance->CoordsToClient(
CellClass::Cell2Coord(pCell->MapCoords, nHeight)
).first;
nPoint.X += offset.X;
nPoint.Y += offset.Y;

CoordStruct coords = CellClass::Cell2Coord(pCell->MapCoords, nHeight);

point = TacticalClass::Instance->CoordsToClient(coords).first;
point.X += offset.X;
point.Y += offset.Y;
}

BlitterFlags blitFlags = pTypeExt->PlacementPreview_Translucency.Get(pRules->PlacementPreview_Translucency) |
BlitterFlags::Centered | BlitterFlags::Nonzero | BlitterFlags::MultiPass;
Expand All @@ -125,10 +127,10 @@ DEFINE_HOOK(0x6D528A, TacticalClass_DrawPlacement_PlacementPreview, 0x6)
: pTypeExt->PlacementPreview_Palette.GetOrDefaultConvert(FileSystem::UNITx_PAL());

DSurface* pSurface = DSurface::Temp;
RectangleStruct nRect = pSurface->GetRect();
nRect.Height -= 32; // account for bottom bar
RectangleStruct rect = pSurface->GetRect();
rect.Height -= 32; // account for bottom bar

CC_Draw_Shape(pSurface, pPalette, pImage, nImageFrame, &nPoint, &nRect, blitFlags,
CC_Draw_Shape(pSurface, pPalette, pImage, nImageFrame, &point, &rect, blitFlags,
0, 0, ZGradient::Ground, 1000, 0, nullptr, 0, 0, 0);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Ext/Techno/Hooks.Misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,5 @@ DEFINE_HOOK(0x739920, UnitClass_TryToDeploy_DisableRegroupAtNewConYard, 0x6)

auto const pRules = RulesExt::Global();

return pRules->GatherWhenMCVDeploy ? DoNotSkipRegroup : SkipRegroup;
return pRules->GatherWhenMCVDeploy ? DoNotSkipRegroup : SkipRegroup;
}
1 change: 0 additions & 1 deletion src/Ext/Techno/Hooks.Pips.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ DEFINE_HOOK(0x70A1F6, TechnoClass_DrawPips_Tiberium, 0x6)
pipOrder.push_back(i);
}
}


for (int i = 0; i < maxPips; i++)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Ext/Techno/Hooks.Tint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ static bool __forceinline IsOnBridge(FootClass* pUnit)
bool containsBridge = pCell->ContainsBridge();
bool containsBridgeDir = static_cast<bool>(pCell->Flags & CellFlags::BridgeDir);

return (containsBridge || containsBridgeDir || pCellAdj->ContainsBridge())
&& (!containsBridge || pCell->GetNeighbourCell(FacingType::West)->ContainsBridge());
return (containsBridge || containsBridgeDir || pCellAdj->ContainsBridge()) &&
(!containsBridge || pCell->GetNeighbourCell(FacingType::West)->ContainsBridge());
}

static void __forceinline GetLevelIntensity(TechnoClass* pThis, int level, int& levelIntensity, int& cellIntensity, double levelMult, bool applyBridgeBonus)
Expand Down
8 changes: 6 additions & 2 deletions src/Ext/TechnoType/Hooks.Teleport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ DEFINE_HOOK(0x7193F6, TeleportLocomotionClass_ILocomotion_Process_WarpoutAnim, 0
if (auto pImage = pType->AlphaImage)
{
auto [xy, _] = TacticalClass::Instance->CoordsToClient(pLinked->Location);
RectangleStruct Dirty = { xy.X - (pImage->Width / 2) , xy.Y - (pImage->Height / 2),
pImage->Width, pImage->Height };
RectangleStruct Dirty = {
xy.X - (pImage->Width / 2),
xy.Y - (pImage->Height / 2),
pImage->Width,
pImage->Height
};
TacticalClass::Instance->RegisterDirtyArea(Dirty, true);
}

Expand Down
40 changes: 20 additions & 20 deletions src/Ext/TechnoType/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,32 +458,32 @@ DEFINE_HOOK(0x73C47A, UnitClass_DrawAsVXL_Shadow, 0x5)
{
if (pType->ShadowIndex >= 0 && pType->ShadowIndex < main_vxl->HVA->LayerCount)
pThis->DrawVoxelShadow(
main_vxl,
pType->ShadowIndex,
vxl_index_key,
&pType->VoxelShadowCache,
bounding,
&why,
&mtx,
true,
surface,
shadow_point
main_vxl,
pType->ShadowIndex,
vxl_index_key,
&pType->VoxelShadowCache,
bounding,
&why,
&mtx,
true,
surface,
shadow_point
);
}
else
{
for (auto& [index, _] : uTypeExt->ShadowIndices)
pThis->DrawVoxelShadow(
main_vxl,
index,
index == pType->ShadowIndex ? vxl_index_key : std::bit_cast<VoxelIndexKey>(-1),
&pType->VoxelShadowCache,
bounding,
&why,
&mtx,
index == pType->ShadowIndex,
surface,
shadow_point
main_vxl,
index,
index == pType->ShadowIndex ? vxl_index_key : std::bit_cast<VoxelIndexKey>(-1),
&pType->VoxelShadowCache,
bounding,
&why,
&mtx,
index == pType->ShadowIndex,
surface,
shadow_point
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Misc/Hooks.BugFixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ DEFINE_HOOK(0x71ADE4, TemporalClass_Release_SlaveTargetFix, 0x5)
}

// In the following three places the distance check was hardcoded to compare with 20, 17 and 16 respectively,
// which means it didn't consider the actual speed of the unit. Now we check it and the units won't get stuck
// which means it didn't consider the actual speed of the unit. Now we check it and the units won't get stuck
// even at high speeds - NetsuNegi

DEFINE_HOOK(0x7295C5, TunnelLocomotionClass_ProcessDigging_SlowdownDistance, 0x9)
Expand Down
2 changes: 1 addition & 1 deletion src/Misc/Hooks.VeinholeMonster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ DEFINE_HOOK(0x73E9A0, UnitClass_Weeder_StopHarvesting, 0x6)

if ((pUnit->Type->Harvester || pUnit->Type->Weeder) && pUnit->GetStoragePercentage() == 1.0)
{
return StopHarvesting;
return StopHarvesting;
}

return Skip;
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/Helpers.Alex.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ namespace Helpers {
}

// flying objects are not included normally
// Starkku: Reimplemented using AircraftTrackerClass.
// Starkku: Reimplemented using AircraftTrackerClass.
if (includeInAir)
{
auto const airTracker = &AircraftTrackerClass::Instance.get();
Expand Down

0 comments on commit 4de837d

Please sign in to comment.