Skip to content

Reimplement projectiles #4353

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

FileEX
Copy link
Collaborator

@FileEX FileEX commented Aug 11, 2025

This PR is one of the steps towards starting a new approach to the project - refactoring and removing ASM and hooks by implementing GTA functionality ourselves.

This PR contains rewritten and improved projectile logic, modified to produce cleaner code than the original, while keeping the behavior exactly the same.

With this PR, we can increase the projectile limit from 32 to any number, and gain full control over projectile behavior. Additionally, the onClientProjectileCreation event can now be canceled, thus eliminating the need for hooks and ASM instructions.

At the moment, the PR is somewhat messy — there are many references to internal functions and raw addresses — but I believe the PR is already quite large, so I don’t want to address that here. Everything will be cleaned up in the next PR so that this one doesn’t become too huge.

I have tested numerous scenarios: all projectiles, thrown manually and from vehicles, projectiles thrown by remote players, and based on my tests I haven’t observed any bugs other than those already present in the original. In my opinion, the code reproduces the original functionality and behavior 100%.

@tzwer
Copy link
Contributor

tzwer commented Aug 11, 2025

Thanks for your efforts!
Will these changes make it possible to calculate how much a projectile traveled? or if a projectile has entered a collision shape?

@FileEX
Copy link
Collaborator Author

FileEX commented Aug 11, 2025

Thanks for your efforts! Will these changes make it possible to calculate how much a projectile traveled? or if a projectile has entered a collision shape?

Yeah

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.

2 participants