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

Un-invert Options.disableDespawning data byte #1463

Merged
merged 4 commits into from
Mar 13, 2022

Conversation

originalfoo
Copy link
Member

For some reason the value of Options.disableDespawning was historically inverted during de/serialization.

GameplayTab_VehicleBehaviourGroup.DisableDespawning.Value = !LoadBool(data, idx: 15, true); // inverted

This PR fixes that by making the serialized value conistent with how all other options work (not inverted), whilst handling legacy value (inverted) if necessary.

It's based in part on new Version field that @kianzarrin put in PR #1211 (note: if merging prior to that PR, Kian would need to change version in his PR to 2).

Also fixes some trivial analyzer warnings I noticed.

For some reason the value of `Options.disableDespawning` was
historically inverted during de/serialization. This PR fixes that.

It's based in part on new `Version` field that Kian put in PR #1211.
@originalfoo originalfoo added code cleanup Refactor code, remove old code, improve maintainability Settings Road config, mod options, config xml labels Mar 12, 2022
@originalfoo originalfoo self-assigned this Mar 12, 2022
@originalfoo originalfoo added this to the 11.6.5.2 milestone Mar 12, 2022
Copy link
Collaborator

@kvakvs kvakvs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A risky endeavour, but alright, good intention

Copy link
Member

@krzychu124 krzychu124 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok 👍

@originalfoo originalfoo modified the milestones: 11.6.5.2, 11.6.5.1 Mar 13, 2022
@originalfoo originalfoo merged commit d9201b3 into master Mar 13, 2022
@originalfoo originalfoo deleted the un-invert-disable-despawning branch March 13, 2022 01:04
@krzychu124
Copy link
Member

I'm not sure why I didn't notice it but.... if we are starting "new game", there won't be Configuration data so public static int Version => _configuration.Version; will throw null ref exception

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code cleanup Refactor code, remove old code, improve maintainability Settings Road config, mod options, config xml
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants