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

fix pLocal/pWeapon being nullptr on first tick of joining a map #22

Merged
merged 3 commits into from
Sep 27, 2024

Conversation

whohyno
Copy link
Contributor

@whohyno whohyno commented Sep 19, 2024

case FRAME_NET_UPDATE_END:
	H::Players.Fill();

would crash your game if you were to pLocal->As<CBasePlayer>() for example

@Viceroyy
Copy link
Owner

Why not move lines 46 and 47 to 38 and 39 and check if (!pLocal || !pWeapon)? And why does that even crash we check for if (pLocal && pWeapon) just below that so we know they're valid, are you sure this is the issue?

@whohyno
Copy link
Contributor Author

whohyno commented Sep 20, 2024

the issue is that FRAME_NET_UPDATE_END happens after createmove and if you were trying to do something like pLocal->As<CBasePlayer>() it would crash before the if statement even rules

yes you are right about the lines thing, i think this would be even better in the lastusercmd function as this does exactly that

btw this only crashes you if you re injecting mid game

@RileyKun
Copy link
Contributor

The entitycache in general is pointless and only complicates things further. I don't know why you guys still use it at all amongst everyone else in their sources.

@Viceroyy
Copy link
Owner

The entitycache in general is pointless and only complicates things further. I don't know why you guys still use it at all amongst everyone else in their sources.

Since I'm focused on my university studies, I won't be able to continue working on this cheat for the foreseeable future. Besides, this cheat was always meant to be a temporary solution while waiting for the release of Amalgam

@whohyno
Copy link
Contributor Author

whohyno commented Sep 23, 2024

understandable, actually the simplest of the fixes would be
H::Entities.Fill();
inside of Core::Load

@sp00kY0
Copy link

sp00kY0 commented Sep 23, 2024

understandable, actually the simplest of the fixes would be
H::Entities.Fill();
inside of Core::Load

Huh?

@RileyKun
Copy link
Contributor

understandable, actually the simplest of the fixes would be H::Entities.Fill(); inside of Core::Load

Most of the issues with pLocal being invalid can be fixed with proper error checking through most of the code...

@Viceroyy
Copy link
Owner

lgtm thanks!

@Viceroyy Viceroyy merged commit 559c665 into Viceroyy:main Sep 27, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants