Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor issue in prediction #54

Closed
ghost opened this issue Dec 25, 2022 · 9 comments
Closed

Minor issue in prediction #54

ghost opened this issue Dec 25, 2022 · 9 comments
Labels
suggestion Suggestion from people, possibility to add in todo list

Comments

@ghost
Copy link

ghost commented Dec 25, 2022

game::localPlayer->m_afButtonPressed() = buttonChanged & (~cmdButtons);

Should be m_afButtonReleased() instead.

@ghost ghost changed the title Minor issue Minor issue in prediction Dec 25, 2022
@Bartis1313
Copy link
Owner

thanks, will fix today

@ghost
Copy link
Author

ghost commented Dec 26, 2022

@Bartis1313 Thanks, can you check as well if yours is correctly updated (from IDA).

csgo/SDK/IPrediction.hpp

Lines 48 to 63 in 84b43ce

class IPrediction
{
public:
VFUNC(void, update, 3, (int startframe, bool validframe, int incomingAcknowledged, int outgoingCommand),
(this, startframe, validframe, incomingAcknowledged, outgoingCommand));
VFUNC(void, setLocalViewangles, 13, (Vec3& angle), (this, std::ref(angle)));
VFUNC(bool, inPrediction, 14, (), (this));
VFUNC(bool, checkMovingGround, 18, (Player_t* player, double frameTime), (this, player, frameTime));
VFUNC(void, setupMove, 20, (Player_t* localPlayer, CUserCmd* cmd, IMoveHelper* moveHelper, CMoveData* moveData), (this, localPlayer, cmd, moveHelper, moveData));
VFUNC(void, finishMove, 21, (Player_t* localPlayer, CUserCmd* cmd, CMoveData* moveData), (this, localPlayer, cmd, moveData));
PAD(8);
bool m_inPrediction;
bool m_firstTimePredicted;
bool m_enginePaused;
};

Latest class info that I got: https://www.unknowncheats.me/forum/3482390-post15919.html

In class IPrediction, I'm confused about m_bFirstTimePredicted and m_bOldCLPredictValue.

@Bartis1313
Copy link
Owner

yes it's correct (yours), while mine not.
Fastest way I did it is to lookup Prediction errors occurred string, which is a reference to leaked sdk
Here to get this var understood correctly, without var renames

if ( *(_DWORD *)(v7 + v3 + 36) && (*(int (__thiscall **)(int *))(dword_1523F5C8 + 52))(&dword_1523F5C8) )
        Warning("Prediction errors occurred at %i %f\n", *(_DWORD *)(off_10DAA8D0 + 28), *(float *)(off_10DAA8D0 + 16));
      v5 = a2;
    }
    v8 = v43 == -1;
    v6 = v43++ + 1;
  }
  while ( v8 );
  v35 = *(_BYTE *)(v3 + 9);
  if ( (*(unsigned __int8 (__thiscall **)(int *))(dword_14DFAA48 + 84))(&dword_14DFAA48) != v35 )

Take a look at this: v35 = *(_BYTE *)(v3 + 9);
and an operation below which is literally in sdk
Another ways would be to lookup cl_predict, but I think it will be leading to same time in getting it, or even slower.

.text:10022AEF 68 E4 AB BB 10                          push    offset aClPredict ; "cl_predict"
.text:10022AF4 B9 48 AA DF 14                          mov     ecx, offset dword_14DFAA48

Will update it also, thanks again!

@ghost
Copy link
Author

ghost commented Dec 26, 2022

Thanks to you, let's get things correct 😃

@ghost
Copy link
Author

ghost commented Dec 27, 2022

@ghost
Copy link
Author

ghost commented Dec 27, 2022

@Bartis1313 So there is both split.m_bFirstTimePredicted and m_bFirstTimePredicted to account?

@Bartis1313
Copy link
Owner

Bartis1313 commented Dec 27, 2022

Idk, seems useless as server overwrites compressed values, can't do anything about it. This is why I don't use those fields at all.
To fix, you can do some compression removal yourself, but I don't know how would you do that.

@Bartis1313
Copy link
Owner

compression removal yourself - probably would end up fixing it as custom networked fields, not sure at all about that. This might break some of the error detections though. So I don't rush with doing it, current code is just what would you take from last leaked source and do it (in most).

@ghost
Copy link
Author

ghost commented Dec 27, 2022

@Bartis1313 Thanks for the clarification, I will look into it 👍, keep up the good work!

@Bartis1313 Bartis1313 added the suggestion Suggestion from people, possibility to add in todo list label Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion Suggestion from people, possibility to add in todo list
Projects
None yet
Development

No branches or pull requests

1 participant