Skip to content

Commit 7ad9e20

Browse files
committed
Review
1 parent 3fbdb2a commit 7ad9e20

File tree

5 files changed

+9
-11
lines changed

5 files changed

+9
-11
lines changed

Client/game_sa/CVehicleSA.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,16 +524,14 @@ void CVehicleSA::SetTrainSpeed(float fSpeed)
524524
pInterface->m_fTrainSpeed = fSpeed;
525525
}
526526

527-
float CVehicleSA::GetHeliRotorSpeed()
527+
float CVehicleSA::GetHeliRotorSpeed() const
528528
{
529-
auto* heliInterface = static_cast<CHeliSAInterface*>(GetInterface());
530-
return heliInterface->m_wheelSpeed[1];
529+
return static_cast<CHeliSAInterface*>(m_pInterface)->m_wheelSpeed[1];
531530
}
532531

533532
void CVehicleSA::SetHeliRotorSpeed(float speed)
534533
{
535-
auto* heliInterface = static_cast<CHeliSAInterface*>(GetInterface());
536-
heliInterface->m_wheelSpeed[1] = speed;
534+
static_cast<CHeliSAInterface*>(GetInterface())->m_wheelSpeed[1] = speed;
537535
}
538536

539537
void CVehicleSA::SetHeliRotorState(bool state, bool stopRotor) noexcept

Client/game_sa/CVehicleSA.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ class CVehicleSA : public virtual CVehicle, public virtual CPhysicalSA
546546
bool GetTakeLessDamage() { return GetVehicleInterface()->m_nVehicleFlags.bTakeLessDamage; };
547547
bool GetTyresDontBurst() { return GetVehicleInterface()->m_nVehicleFlags.bTyresDontBurst; };
548548
unsigned short GetAdjustablePropertyValue() { return *reinterpret_cast<unsigned short*>(reinterpret_cast<unsigned long>(m_pInterface) + 2156); };
549-
float GetHeliRotorSpeed();
549+
float GetHeliRotorSpeed() const;
550550
bool GetHeliRotorState() const noexcept override { return m_heliRotorState; }
551551
float GetPlaneRotorSpeed();
552552

Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4279,7 +4279,7 @@ std::variant<bool, std::array<CVector, 4>> CLuaVehicleDefs::OOP_GetVehicleEntryP
42794279
return entryPoints;
42804280
}
42814281

4282-
bool CLuaVehicleDefs::SetHeliRotorState(CClientVehicle* vehicle, bool state, std::optional<bool> stopRotor)
4282+
bool CLuaVehicleDefs::SetHeliRotorState(CClientVehicle* vehicle, bool state, std::optional<bool> stopRotor) noexcept
42834283
{
42844284
if (vehicle->GetVehicleType() != eClientVehicleType::CLIENTVEHICLE_HELI)
42854285
return false;
@@ -4288,7 +4288,7 @@ bool CLuaVehicleDefs::SetHeliRotorState(CClientVehicle* vehicle, bool state, std
42884288
return true;
42894289
}
42904290

4291-
bool CLuaVehicleDefs::GetHeliRotorState(CClientVehicle* vehicle)
4291+
bool CLuaVehicleDefs::GetHeliRotorState(CClientVehicle* vehicle) noexcept
42924292
{
42934293
return vehicle->GetHeliRotorState();
42944294
}

Client/mods/deathmatch/logic/luadefs/CLuaVehicleDefs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ class CLuaVehicleDefs : public CLuaDefs
166166
static bool SetVehicleModelWheelSize(const unsigned short usModel, const eResizableVehicleWheelGroup eWheelGroup, const float fWheelSize);
167167
static int GetVehicleWheelFrictionState(CClientVehicle* pVehicle, unsigned char wheel);
168168

169-
static bool SetHeliRotorState(CClientVehicle* const vehicle, bool state, std::optional<bool> stopRotor);
170-
static bool GetHeliRotorState(CClientVehicle* const vehicle);
169+
static bool SetHeliRotorState(CClientVehicle* const vehicle, bool state, std::optional<bool> stopRotor) noexcept;
170+
static bool GetHeliRotorState(CClientVehicle* const vehicle) noexcept;
171171

172172
// Components
173173
LUA_DECLARE(SetVehicleComponentPosition);

Client/sdk/game/CVehicle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class CVehicle : public virtual CPhysical
198198
virtual bool GetTakeLessDamage() = 0;
199199
virtual bool GetTyresDontBurst() = 0;
200200
virtual unsigned short GetAdjustablePropertyValue() = 0;
201-
virtual float GetHeliRotorSpeed() = 0;
201+
virtual float GetHeliRotorSpeed() const = 0;
202202
virtual bool GetHeliRotorState() const noexcept = 0;
203203
virtual float GetPlaneRotorSpeed() = 0;
204204
virtual unsigned long GetExplodeTime() = 0;

0 commit comments

Comments
 (0)