YimMenu / YimMenu

YimMenu, a GTA V menu protecting against a wide ranges of the public crashes and improving the overall experience.
https://yim.gta.menu
GNU General Public License v2.0
1.16k stars 930 forks source link

fixed get_player_rank and get_player_rp #3228

Closed USBMenus closed 1 week ago

USBMenus commented 3 weeks ago

fixed the network commands get_player_rank and get_player_rp so that when the user uses them on the local player it returns the correct values instead of -1

closes #3226

lonelybud commented 3 weeks ago

these changes wont actually fix #3226 bcz we dont add self pointer in player list.

https://github.com/YimMenu/YimMenu/blob/8bbab4c76531a905a885f667af34315516489534/src/services/players/player_service.cpp#L96

xiaoxiao921 commented 3 weeks ago

these changes wont actually fix #3226 bcz we dont add self pointer in player list.

https://github.com/YimMenu/YimMenu/blob/8bbab4c76531a905a885f667af34315516489534/src/services/players/player_service.cpp#L96

i'm curious what was the reasoning behind this, doesn't seem logical at all.

lonelybud commented 3 weeks ago

i'm curious what was the reasoning behind this, doesn't seem logical at all.

there is get_self function to get self pointer since this pointer is needed extensively in code. To avoid duplication it might not have been to player list. We usually see this practice in code

xiaoxiao921 commented 3 weeks ago

... What?

lonelybud commented 3 weeks ago

there is lot of things like processing in assign_physical_index where we dont want to run check on ourselves? just one example -

https://github.com/YimMenu/YimMenu/blob/8bbab4c76531a905a885f667af34315516489534/src/hooks/player_management/assign_physical_index.cpp#L93