Skip to content
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

Rework on movements revscriptsys #398

Merged
merged 6 commits into from
Jun 1, 2022
Merged

Conversation

dudantas
Copy link
Contributor

@dudantas dudantas commented May 30, 2022

Movements completely redone to remove a memory leak related to the registration of movements, in the luaMoveEventRegister function, where the memory was fread and then used. We also added some pointer sanity checks, preventing future crashes and fixing some known ones.

  • Removed old XML load
  • Passed some objects as a reference, to avoid nullpointer
  • Added nullpointer checks in some places and the code was redone to work better
  • Added some logs to help in case of errors
  • Fixed crash related to replaceable magic fields

Notes: MoveEvent::onRemoveItem function from now on it will no longer have the "tileitem" argument

Fix crash related to replaceable, validating some nullpointer, remove usings and some indentations
Changed from "!" to explicit "nullpointer" comparison
Added MagicField validation
@dudantas dudantas force-pushed the rework-on-movements-revscriptsys branch 2 times, most recently from 17abc67 to d0ed88c Compare May 31, 2022 17:55
Fix register items
Some sonar fixes
@dudantas dudantas force-pushed the rework-on-movements-revscriptsys branch 2 times, most recently from 17a67cb to da0b453 Compare May 31, 2022 18:27
@dudantas dudantas force-pushed the rework-on-movements-revscriptsys branch from da0b453 to b6ae291 Compare May 31, 2022 18:28
@sonarcloud
Copy link

sonarcloud bot commented May 31, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 11 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@dudantas dudantas merged commit 4771913 into main Jun 1, 2022
@dudantas dudantas deleted the rework-on-movements-revscriptsys branch June 1, 2022 17:19
luan pushed a commit that referenced this pull request Jul 11, 2023
Movements completely redone to remove a memory leak related to the registration of movements, in the luaMoveEventRegister function, where the memory was fread and then used. We also added some pointer sanity checks, preventing future crashes and fixing some known ones.

Removed old XML load
Passed some objects as a reference, to avoid nullpointer
Added nullpointer checks in some places and the code was redone to work better
Added some logs to help in case of errors
Fixed crash related to replaceable magic fields

Notes: MoveEvent::onRemoveItem function from now on it will no longer have the "tileitem" argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants