mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2024-12-22 20:17:24 +08:00
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:
parent
97bf6616ce
commit
77393a5565
@ -17,7 +17,7 @@ namespace big
|
|||||||
|
|
||||||
CVehicle* player::get_current_vehicle() const
|
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)
|
if (const auto vehicle = ped->m_vehicle; vehicle != nullptr)
|
||||||
return vehicle;
|
return vehicle;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
@ -47,8 +47,8 @@ namespace big
|
|||||||
|
|
||||||
CPed* player::get_ped() const
|
CPed* player::get_ped() const
|
||||||
{
|
{
|
||||||
if (const auto player_info = this->get_player_info(); player_info != nullptr)
|
if (auto player_info = get_player_info())
|
||||||
if (const auto ped = player_info->m_ped; ped != nullptr)
|
if (auto ped = player_info->m_ped)
|
||||||
return ped;
|
return ped;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@ -161,7 +161,7 @@ namespace big
|
|||||||
|
|
||||||
std::string player::to_lowercase_identifier() const
|
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);
|
std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
|
||||||
|
|
||||||
return lower;
|
return lower;
|
||||||
|
Loading…
Reference in New Issue
Block a user