Open
Conversation
Member
Author
|
Ready for review, cleanup will follow later in separate PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR is similar to #4353 because it also implements its own fire handling, effectively disabling the default GTA functions. Reimplementing a specific feature is generally a better approach than adding more ASM hooks just to change or add something, although it obviously requires knowledge and time. This PR is not yet fully complete, but a large portion of the work - i.e., reverse engineering the original code (gta-reversed often contains errors/mistakes/bugs, so verification is always necessary) and its own implementation.. has already been done. Ultimately, this PR is intended only to pave the way for subsequent PRs. Due to its size, it will not contain everything.
Benefits of the reimplementation:
createFirewill return a CClientFire element that can be moved withsetElementPositionor destroyed viadestroyElementallowing individual flames to be extinguished without affecting the surrounding areasetElementFireProof/isElementFireProof) - useful for things like fire-resistant firefighter outfits, etc.createFireand other fire functions available as sharedThere’s potentially much more that can be done; with a custom implementation, virtually anything is possible. If anyone has interesting ideas, they can share them here.
TODO for this PR to be ready:
- Create theCClientFireclass so fires created viacreateFiregenerate this element and can be moved or destroyed- Fix bugs originally handled via hooks in CMultiplayerSA- ImplementextinguishAllFiresMotivation
#888
Very little control over fire. createFire only returns a bool, and until recently you couldn’t even extinguish fires. This is probably the most underdeveloped and neglected feature in MTA..
Test plan
The PR is currently stable. I’ve been testing it over the past two days, fixing numerous bugs. At this point, the fire behavior in the MTA matches the default exactly and I haven’t observed any bugs or deviations from the original behavior.
Checklist