Remove redundant nullptr checks in player::get_ped(). (#3095)

* chore(Player): remove `this` keyword

Co-authored-by: Andreas Maerten <24669514+Yimura@users.noreply.github.com>
This commit is contained in:
gir489 2024-05-11 17:23:26 -04:00 committed by GitHub
parent f81d40854d
commit 773f57bacc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,7 +17,7 @@ namespace big
CVehicle* player::get_current_vehicle() const
{
if (const auto ped = this->get_ped(); ped != nullptr)
if (const auto ped = get_ped(); ped != nullptr)
if (const auto vehicle = ped->m_vehicle; vehicle != nullptr)
return vehicle;
return nullptr;
@ -47,8 +47,8 @@ namespace big
CPed* player::get_ped() const
{
if (const auto player_info = this->get_player_info(); player_info != nullptr)
if (const auto ped = player_info->m_ped; ped != nullptr)
if (auto player_info = get_player_info())
if (auto ped = player_info->m_ped)
return ped;
return nullptr;
}
@ -161,7 +161,7 @@ namespace big
std::string player::to_lowercase_identifier() const
{
std::string lower = this->get_name();
std::string lower = get_name();
std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
return lower;