Skip to content

Commit 72fbde4

Browse files
committed
regulate float values
1 parent edd7bff commit 72fbde4

12 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/Ext/Building/Body.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void BuildingExt::StoreTiberium(BuildingClass* pThis, float amount, int idxTiber
7171
float depositableTiberiumAmount = 0.0f; // Number of 'bails' that will be stored.
7272
auto const pTiberium = TiberiumClass::Array.GetItem(idxTiberiumType);
7373

74-
if (amount > 0.0)
74+
if (amount > 0.0f)
7575
{
7676
auto const pExt = BuildingTypeExt::ExtMap.Find(pThis->Type);
7777

src/Ext/BuildingType/Body.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class BuildingTypeExt
119119
, PowerPlant_DamageFactor { 1.0 }
120120
, PowerPlantEnhancer_Buildings {}
121121
, PowerPlantEnhancer_Amount { 0 }
122-
, PowerPlantEnhancer_Factor { 1.0 }
122+
, PowerPlantEnhancer_Factor { 1.0f }
123123
, PowerPlantEnhancer_MaxCount { -1 }
124124
, OccupierMuzzleFlashes()
125125
, Powered_KillSpawns { false }

src/Ext/House/Body.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ int HouseExt::ExtData::GetFactoryCountWithoutNonMFB(AbstractType rtti, bool isNa
537537

538538
float HouseExt::ExtData::GetRestrictedFactoryPlantMult(TechnoTypeClass* pTechnoType) const
539539
{
540-
float mult = 1.0;
540+
float mult = 1.0f;
541541
auto const pTechnoTypeExt = TechnoTypeExt::ExtMap.Find(pTechnoType);
542542
std::unordered_map<int, int> counts;
543543

src/Ext/Script/Body.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ void ScriptExt::ChronoshiftTeamToTarget(TeamClass* pTeam, TechnoClass* pTeamLead
11971197

11981198
if (!pSuperCSphere->IsReady || (pSuperCSphere->IsPowered() && !pOwner->Is_Powered()))
11991199
{
1200-
if (pSuperCSphere->IsPresent && 1.0 - RulesClass::Instance->AIMinorSuperReadyPercent < pSuperCSphere->RechargeTimer.GetTimeLeft() / pSuperCSphere->GetRechargeTime())
1200+
if (pSuperCSphere->IsPresent && 1.0f - RulesClass::Instance->AIMinorSuperReadyPercent < pSuperCSphere->RechargeTimer.GetTimeLeft() / pSuperCSphere->GetRechargeTime())
12011201
{
12021202
ScriptExt::Log(logTextBase, "ChronoSphere superweapon [%s] charge not at AIMinorSuperReadyPercent yet, not jumping to next line yet");
12031203
return;

src/Ext/Sidebar/SWSidebar/SWButtonClass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ bool SWButtonClass::Action(GadgetFlag flags, DWORD* pKey, KeyModifier modifier)
163163
if (flags & GadgetFlag::LeftPress)
164164
{
165165
MouseClass::Instance.UpdateCursor(MouseCursorType::Default, false);
166-
VocClass::PlayGlobal(RulesClass::Instance->GUIBuildSound, 0x2000, 1.0);
166+
VocClass::PlayGlobal(RulesClass::Instance->GUIBuildSound, 0x2000, 1.0f);
167167
this->LaunchSuper();
168168
}
169169

src/Ext/Sidebar/SWSidebar/ToggleSWButtonClass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void ToggleSWButtonClass::UpdatePosition()
100100

101101
bool ToggleSWButtonClass::SwitchSidebar()
102102
{
103-
VocClass::PlayGlobal(RulesClass::Instance->GUIMainButtonSound, 0x2000, 1.0);
103+
VocClass::PlayGlobal(RulesClass::Instance->GUIMainButtonSound, 0x2000, 1.0f);
104104
ScenarioExt::Global()->SWSidebar_Enable = !ScenarioExt::Global()->SWSidebar_Enable;
105105

106106
const bool disabled = !SWSidebarClass::IsEnabled();

src/Ext/Techno/Hooks.Misc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ DEFINE_HOOK(0x74691D, UnitClass_UpdateDisguise_EMP, 0x6)
512512
GET(UnitClass*, pThis, ESI);
513513
// Remove mirage disguise if under emp or being flipped, approximately 15 deg
514514
// Deactivated mirage should still be able to keep disguise
515-
if (pThis->IsUnderEMP() || std::abs(pThis->AngleRotatedForwards) > 0.25 || std::abs(pThis->AngleRotatedSideways) > 0.25)
515+
if (pThis->IsUnderEMP() || std::abs(pThis->AngleRotatedForwards) > 0.25f || std::abs(pThis->AngleRotatedSideways) > 0.25f)
516516
{
517517
pThis->ClearDisguise();
518518
R->EAX(pThis->MindControlRingAnim);

src/Ext/Techno/Hooks.ReceiveDamage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ DEFINE_HOOK(0x701900, TechnoClass_ReceiveDamage_Shield, 0x6)
117117
if (!RulesExt::Global()->CombatAlert_MakeAVoice) // No one want to play two sound at a time, I guess?
118118
return;
119119
else if (pTypeExt->CombatAlert_UseFeedbackVoice.Get(RulesExt::Global()->CombatAlert_UseFeedbackVoice) && pType->VoiceFeedback.Count > 0) // Use VoiceFeedback first
120-
VocClass::PlayGlobal(pType->VoiceFeedback.GetItem(0), 0x2000, 1.0);
120+
VocClass::PlayGlobal(pType->VoiceFeedback.GetItem(0), 0x2000, 1.0f);
121121
else if (pTypeExt->CombatAlert_UseAttackVoice.Get(RulesExt::Global()->CombatAlert_UseAttackVoice) && pType->VoiceAttack.Count > 0) // Use VoiceAttack then
122-
VocClass::PlayGlobal(pType->VoiceAttack.GetItem(0), 0x2000, 1.0);
122+
VocClass::PlayGlobal(pType->VoiceAttack.GetItem(0), 0x2000, 1.0f);
123123
else if (pTypeExt->CombatAlert_UseEVA.Get(RulesExt::Global()->CombatAlert_UseEVA)) // Use Eva finally
124124
index = pTypeExt->CombatAlert_EVA.Get(VoxClass::FindIndex((const char*)"EVA_UnitsInCombat"));
125125

src/Ext/TechnoType/Body.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ TechnoClass* TechnoTypeExt::CreateUnit(CreateUnitTypeClass* pCreateUnit, DirType
571571
auto pCell = MapClass::Instance.TryGetCellAt(location);
572572
auto const speedType = rtti != AbstractType::AircraftType ? pType->SpeedType : SpeedType::Wheel;
573573
auto const mZone = rtti != AbstractType::AircraftType ? pType->MovementZone : MovementZone::Normal;
574-
const bool allowBridges = GroundType::Array[static_cast<int>(LandType::Clear)].Cost[static_cast<int>(speedType)] > 0.0;
574+
const bool allowBridges = GroundType::Array[static_cast<int>(LandType::Clear)].Cost[static_cast<int>(speedType)] > 0.0f;
575575
bool isBridge = allowBridges && pCell && pCell->ContainsBridge();
576576
const int baseHeight = location.Z;
577577
bool inAir = location.Z >= Unsorted::CellHeight * 2;

src/Ext/TechnoType/Body.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ class TechnoTypeExt
511511
, RadarJamIgnore {}
512512
, InhibitorRange {}
513513
, DesignatorRange { }
514-
, FactoryPlant_Multiplier { 1.0 }
514+
, FactoryPlant_Multiplier { 1.0f }
515515
, MindControlRangeLimit {}
516516
, MindControl_IgnoreSize { true }
517517
, MindControlSize { 1 }
@@ -588,7 +588,7 @@ class TechnoTypeExt
588588
, OpenTopped_UseTransportRangeModifiers { false }
589589
, OpenTopped_CheckTransportDisableWeapons { false }
590590
, OpenTransport_RangeBonus { 0 }
591-
, OpenTransport_DamageMultiplier { 1.0 }
591+
, OpenTransport_DamageMultiplier { 1.0f }
592592

593593
, AutoTargetOwnPosition { false }
594594
, AutoTargetOwnPosition_Self { false }

0 commit comments

Comments
 (0)