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

Simplify categorizing spells for drawing reticle in config #189

Closed
szapp opened this issue Sep 19, 2018 · 0 comments
Closed

Simplify categorizing spells for drawing reticle in config #189

szapp opened this issue Sep 19, 2018 · 0 comments

Comments

@szapp
Copy link
Owner

szapp commented Sep 19, 2018

The reticle for spells is currently determined by spell ID in separate files for Gothic 1 and Gothic 2 in the config.

This decreases compatibility with mods that may have removed spells or renamed their ID constants. A viable method could be to compare the names of the spell instances instead. This would also make discerning between Gothic 1 and Gothic 2 obsolete.

Example code:

var string instName;
instName = MEM_ReadString(MEM_GetSymbolByIndex(Hlp_GetInstanceID(spellInst)));

if (STR_IndexOf(instName, "FIRE") != -1)
|| (STR_IndexOf(instName, "PYRO") != -1) {
    // Fire spells
    return RETICLE_HORNS;
} else if (STR_IndexOf(instName, "ICE") != -1)
|| (STR_IndexOf(instName, "THUNDER") != -1) {
    // Ice spells
    return RETICLE_SPADES;
} else if { // ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant