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

fix mutations overriding spell level #34166

Merged
merged 1 commit into from
Sep 22, 2019

Conversation

KorGgenT
Copy link
Member

Summary

SUMMARY: Bugfixes "Fix mutation-learned spells overriding spell level upon load"

Purpose of change

Brought to my attention here:
chaosvolt/cdda-arcana-mod#82

Spells learned from a mutation were loaded in before the spellbook, because of on_mutation_gain adding the spell before the spellbook loaded in. Due to the spellbook being a map and the load spell using emplace(), the xp saved did not overwrite the original spell given by the mutation.

Describe the solution

Check if the spell is already known when loading the spell, and overwrite the xp if known. adds a new set_exp() function to spell to accomplish this

Additional context

image

@KorGgenT KorGgenT added Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) labels Sep 22, 2019
@ZhilkinSerg ZhilkinSerg merged commit bc74033 into CleverRaven:master Sep 22, 2019
@KorGgenT KorGgenT deleted the mutation-spell-fix branch September 22, 2019 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants