-
Notifications
You must be signed in to change notification settings - Fork 92
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
Creature: Add SetMulticlassLimit #1788
Conversation
8f7d6c2
to
a17c316
Compare
Plugins/Creature/Creature.cpp
Outdated
|
||
NWNX_EXPORT ArgumentStack SetMulticlassLimit(ArgumentStack&& args) | ||
{ | ||
if (!s_bGetIsClassAvailableHookInitialized) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to check/set a static bool, the static hook below will only be initialized once
Plugins/Creature/Creature.cpp
Outdated
static Hooks::Hook s_GetClassLevelHook = nullptr; | ||
|
||
static std::unordered_map<uint8_t, std::unordered_map<ObjectID, int16_t>> s_RollModifier; | ||
static std::unordered_map<ObjectID, bool> s_ParryAllAttacks; | ||
static std::unordered_map<OBJECT_ID, uint> s_MulticlassLimits; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why an unordered_map instead of using NWNX's POS? With POS you can have it persist to the bic too
a17c316
to
352447d
Compare
Thanks Daz. I removed the static bool and switched to using POS. |
Maybe add a |
352447d
to
94913fe
Compare
Added a get function. |
Adds
NWNX_Creature_SetMulticlassLimit(object oCreature, int nLimit)
to limit the number of classes a PC can take dynamically.