Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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%.