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

Vehicle Damage - Code cleanup #9831

Merged
merged 66 commits into from
Aug 20, 2024
Merged

Vehicle Damage - Code cleanup #9831

merged 66 commits into from
Aug 20, 2024

Conversation

johnb432
Copy link
Contributor

@johnb432 johnb432 commented Mar 6, 2024

When merged this pull request will:

  • Use vanilla hashmaps instead of CBA hashmaps.
  • Moved EGVAR(cookoff,canHaveFireJet) = 1; to config, as the default was 1 with [_configOf >> QEGVAR(cookoff,canHaveFireJet), "number", 1] call CBA_fnc_getConfigEntry. CBA_fnc_getConfigEntry is about 2-3x more performance intentsive than the getX config commands, so I switched over to the getX commands as much as possible.
  • Use a global hashmap to store vehicle hitpoints, instead of storing a vehicle's hashmap in a vehicle variable.
  • Fix a case-sensitive bug: toLowerANSI hitpoint aliases, which weren't guaranteed to be lowercase.
  • Renamed FUNC(addDamage) to FUNC(setDamage), as it doesn't add to existing damage, it sets it.
  • Code cleanup.

This is ready for review, but it needs testing. I have tested it, behaves as it did previously.

I haven't really touched the core logic of vehicle damage, so don't expect it to be magically fixed. With help, I am willing to redo some of the logic though.

IMPORTANT

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

@johnb432 johnb432 changed the title Vehicle damage - Improve multiple aspects Vehicle damage - Code cleanup Jun 29, 2024
@johnb432 johnb432 added kind/optimization Release Notes: **IMPROVED:** and removed kind/enhancement Release Notes: **IMPROVED:** labels Jun 29, 2024
@johnb432 johnb432 marked this pull request as ready for review August 11, 2024 14:30
@johnb432 johnb432 added this to the 3.18.0 milestone Aug 11, 2024
@LinkIsGrim LinkIsGrim merged commit 80b2fa9 into master Aug 20, 2024
8 checks passed
@LinkIsGrim LinkIsGrim deleted the vehicle-damage-fixes branch August 20, 2024 19:23
@johnb432 johnb432 changed the title Vehicle damage - Code cleanup Vehicle Damage - Code cleanup Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/optimization Release Notes: **IMPROVED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants