1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00

Fix a couple narrowing conversions in vehicle entity.

This commit is contained in:
Sandu Liviu Catalin 2021-07-23 17:29:32 +03:00
parent 47519cb3f4
commit e2e9d2c83f
2 changed files with 8 additions and 8 deletions

View File

@ -306,7 +306,7 @@ void CVehicle::Respawn() const
}
// ------------------------------------------------------------------------------------------------
int32_t CVehicle::GetImmunity() const
uint32_t CVehicle::GetImmunity() const
{
// Validate the managed identifier
Validate();
@ -315,12 +315,12 @@ int32_t CVehicle::GetImmunity() const
}
// ------------------------------------------------------------------------------------------------
void CVehicle::SetImmunity(int32_t flags)
void CVehicle::SetImmunity(uint32_t flags)
{
// Validate the managed identifier
Validate();
// Grab the current value for this property
const int32_t current = _Func->GetVehicleImmunityFlags(m_ID);
const uint32_t current = _Func->GetVehicleImmunityFlags(m_ID);
// Avoid property unwind from a recursive call
_Func->SetVehicleImmunityFlags(m_ID, static_cast< uint32_t >(flags));
// Avoid infinite recursive event loops
@ -329,7 +329,7 @@ void CVehicle::SetImmunity(int32_t flags)
// Prevent this event from triggering while executed
BitGuardU32 bg(m_CircularLocks, VEHICLECL_EMIT_VEHICLE_IMMUNITY);
// Now forward the event call
Core::Get().EmitVehicleImmunity(m_ID, current, flags);
Core::Get().EmitVehicleImmunity(m_ID, static_cast< int32_t >(current), static_cast< int32_t >(flags));
}
}
@ -1130,7 +1130,7 @@ void CVehicle::ResetHandlings() const
}
// ------------------------------------------------------------------------------------------------
int32_t CVehicle::GetLightsData() const
uint32_t CVehicle::GetLightsData() const
{
// Validate the managed identifier
Validate();

View File

@ -250,12 +250,12 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the immunity flags of the managed vehicle entity.
*/
SQMOD_NODISCARD int32_t GetImmunity() const;
SQMOD_NODISCARD uint32_t GetImmunity() const;
/* --------------------------------------------------------------------------------------------
* Modify the immunity flags of the managed vehicle entity.
*/
void SetImmunity(int32_t flags);
void SetImmunity(uint32_t flags);
/* --------------------------------------------------------------------------------------------
* Explode the managed vehicle entity.
@ -605,7 +605,7 @@ public:
/* --------------------------------------------------------------------------------------------
* Retrieve the lights data for the managed vehicle entity.
*/
SQMOD_NODISCARD int32_t GetLightsData() const;
SQMOD_NODISCARD uint32_t GetLightsData() const;
/* --------------------------------------------------------------------------------------------
* Modify the lights data for the managed vehicle entity.