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

Additional check for somber weapon level #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

singlenumber
Copy link

@singlenumber singlenumber commented Apr 22, 2024

For ER-Save-Editor/src/vm/vm.rs, line: 219

let is_somber = weapon_param.data.reinforceTypeId != 0 && (
      weapon_param.data.reinforceTypeId % 2200 == 0 ||
      weapon_param.data.reinforceTypeId % 2400 == 0 ||
      weapon_param.data.reinforceTypeId % 3200 == 0 ||
      weapon_param.data.reinforceTypeId % 3300 == 0 ||
      weapon_param.data.reinforceTypeId % 8300 == 0 ||
      weapon_param.data.reinforceTypeId % 8500 == 0
);

I think this is not enough to check if weapon is somber, for some save data, non somber weapon reinforceTypeId could be 2200, weapon will be consider somber and break logic in line:229, because non somber level can be greater than 10, it cause key can't be found in hash error.

let weapon_level = if is_somber{
    somber_to_normal[&((storage_item.item_id % 100) as u8)]
}

I add another check, at least it will work for non-somber weapon with level > 10.
But it has problem for non-somber weapon with level <= 10.

Test:
cargo build
cargo run

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.

None yet

1 participant