Skip to content

Comments

Fire reimplementation#4707

Open
FileEX wants to merge 14 commits intomultitheftauto:masterfrom
FileEX:feature/fire-reimplement
Open

Fire reimplementation#4707
FileEX wants to merge 14 commits intomultitheftauto:masterfrom
FileEX:feature/fire-reimplement

Conversation

@FileEX
Copy link
Member

@FileEX FileEX commented Feb 14, 2026

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:

  • No 60-fire limit
  • Full control over fire: custom lifespan, position, size (particle), and ability to enable/disable fire sound
  • Fires created via createFire will return a CClientFire element that can be moved with setElementPosition or destroyed via destroyElement allowing individual flames to be extinguished without affecting the surrounding area
  • Functions enabling fire immunity (setElementFireProof / isElementFireProof) - useful for things like fire-resistant firefighter outfits, etc.
  • Server synchronization; createFire and other fire functions available as shared
  • Ability to enable/disable fire spreading, e.g., via a special world property. Currently this is permanently disabled in MTA for unknown reasons.
  • Introduction of events to notify about fire creation (if deemed necessary)

There’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 the CClientFire class so fires created via createFire generate this element and can be moved or destroyed
- Fix bugs originally handled via hooks in CMultiplayerSA
- Implement extinguishAllFires

Motivation

#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

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

@FileEX FileEX requested a review from a team as a code owner February 14, 2026 23:27
@FileEX FileEX added enhancement New feature or request refactor bugfix Solution to a bug of any kind labels Feb 14, 2026
@FileEX FileEX marked this pull request as draft February 14, 2026 23:27
@FileEX FileEX marked this pull request as ready for review February 22, 2026 08:47
@FileEX
Copy link
Member Author

FileEX commented Feb 22, 2026

Ready for review, cleanup will follow later in separate PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Solution to a bug of any kind enhancement New feature or request refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant