Skip to content

Conversation

ArranTuna
Copy link
Collaborator

onElementDataChange can now be cancelled when a client, setElementData, or removeElementData changes an element data. This is useful because right now you have to do setElementData to cancel a change, which broadcasts to all players and also triggers the event again. Being able to just cancel the event is the cleanest way to deal with unauthorized data changes.

I tested it as many ways as I could think of to try and break it but everything works as intended.

This is version 2 of #4477 because I had to fix some conflicts and did it wrong and ended up deleting the commits in the first PR.

onElementDataChange can now be cancelled when a client, setElementData, or removeElementData changes an element data.
This is useful because right now you have to do setElementData to cancel a change, which broadcasts to all players and also triggers the event again. Being able to just cancel the event is the cleanest way to deal with unauthorized data changes.
@tederis tederis added the enhancement New feature or request label Oct 2, 2025
@Dutchman101 Dutchman101 merged commit 3ab39b8 into multitheftauto:master Oct 7, 2025
3 of 7 checks passed
MTABot pushed a commit that referenced this pull request Oct 7, 2025
3ab39b8 Cancel data change (#4503)
20d36cd `getElementDistanceFromCentreOfMassToBaseOfModel` add 'building' (#4504)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants