Skip to content

Fix multiple damage instances in certain areas during explosions #4187

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 1 commit into
base: master
Choose a base branch
from

Conversation

FileEX
Copy link
Contributor

@FileEX FileEX commented May 2, 2025

Fixes #997 and #4125

The world in SA is divided into sectors for optimization purposes. Sectors are determined based on position, and it's possible for a single point to be located in multiple sectors simultaneously — for example, at the corner where four sectors meet. To prevent logic from being processed multiple times for the same entities, a mechanism called 'scan codes' was introduced. When scanning sectors, a new scan code is set, and each entity is assigned the current scan code during processing. Entities that already have the current scan code are skipped, as they've already been handled.

For some reason, R* likely forgot to include the scan code logic in the explosion-related functions, which caused the same entities to be processed (and receive damage) multiple times. This explains why the bug only occurred in specific areas — those happened to be at sector boundaries where a point was part of multiple sectors simultaneously

@FileEX FileEX changed the title Fix bug Fix multiple damage instances in certain areas during explosions May 2, 2025
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.

onClientPlayerDamage/onClientVehicleDamage - triggers twice for explosion
1 participant