158 - Molten Core not applying to Soul Fire (2 bug fixes for your approval)
Molten Core wasn't applying to Soul Fire. I found a bug in the code and fixed it. Posting the fixed code along with specific details of what I changed:
You had Soul Fire listed twice in the code, once for the Molten Core calculation, and once for the T10 set bonus. I think (I'm not very experienced with Lua, all my programming experience deals with Java) that the addon was only counting the second function when it was calculating Soul Fire's damage, and ignoring the Molten Core code. I consolidated the two functions, and it seems to be working properly now.
I also think I found a bug with Fire and Brimstone applying to Incinerate and Chaos Bolt. The lines of code were
calculation.dmgM = calculation.dmgM * (1 + (Talents["Fire and Brimstone"] or 0))
(Incinerate)
calculation.dmgM = calculation.dmgM * 1 + (Talents["Fire and Brimstone"])
(Chaos Bolt)
I changed them both to
calculation.dmgM = calculation.dmgM * (1 + 0.02 * Talents["Fire and Brimstone"])
since the "or 0" part of the incinerate code appeared redundant, as it didn't appear anywhere else.
| Name | Description | Size | MD5 |
|---|---|---|---|
| Warlock.lua | The altered code for reference | 43.5 KiB | 169b8088b521... |
- 2 comments
- 2 comments
Facts
- Last updated
- Apr 23, 2010
- Reported
- Apr 22, 2010
- Status
- Fixed - Developer made requested changes. QA should verify.
- Type
- Enhancement - A change which is intended to better the project in some way
- Priority
- Medium - Normal priority.
- Votes
- 0
- Reply
- #2
enigma3d Apr 23, 2010 at 06:45 UTC - 0 likesMy apologies then, I didn't read all of the code, and just assumed it was wrong because it was different from how you applied molten core to incinerate or soul fire. Was going for consistency as I don't have a lot of experience with Lua.
- Reply
- #1
Gagorian Apr 22, 2010 at 22:00 UTC - 0 likesGood job catching the double soul fire entry, you're right that only the latter one is calculated as the table entry is replaced by it.
I can't see any bug with Fire and Brimstone though. The "or 0" is necessary since the table entry is nil unless you have the talent (in other parts of the code the talent is checked before). Also multiplying the table entry by 0.02 is wrong as the table entry already contains the true talent value, not the number of points allocated in the talent (You can see how the talents are defined in the talent table at the bottom of the class module, some are set to contain the number of points, while most contain the value of the talent depending on the usage in the module).
I've added the fix for Soul Fire in the latest alpha.