Keen Edge - Sorcerer
-
It does not seem to expire when it should if at all. Have had a sorcerer cast it on me twice and it has last like 5-7 irl hours.
-
Duration: 10 minutes / levelhttps://nwn.fandom.com/wiki/Keen_edge
So, level 10, should be 100 minutes
10 minutes is 60 * 10 = 600
10 * 10 (100) minutes = 6000 seconds
Code does
int nDuration = 60 * GetAdjustedCasterLevel(OBJECT_SELF);This is 60 * level (10 * 60) = 600
AddKeenEffectToWeapon(oMyWeapon, TurnsToSeconds(nDuration));// Convert nTurns into a number of seconds
// A turn is always 60.0 seconds
float TurnsToSeconds(int nTurns)so this sends 600 turns into turns to seconds.
600 turns, is 600 * 60 seconds
36000 seconds
That looks like too many seconds.
I think the code should just do
int nDuration = 10 * GetAdjustedCasterLevel(OBJECT_SELF); AddKeenEffectToWeapon(oMyWeapon, TurnsToSeconds(nDuration));As that would send 10 per level into turns to seconds, which would be ten minutes, per level.
Right?
Also it doesn't handle metamagic, should it?
-
@Zool Yes, that's all kinds of messed up. Too long, and should handle metamagic.
-
Found the origin of the problem, someone needed to pass a function but the function was looking for a float; so they just multiplied the nDuration by 60 again to turn it into a float without removing the first check.
Also put back in support for Extend metamagic.
-
M Mr.Moloch moved this topic from Bug Reports