Page 1 of 1
Combat:getDammod:subs hook not used anymore?
Posted: Sun Feb 03, 2019 2:38 am
by Doctornull
Code: Select all
class:bindHook("Combat:getDammod:subs",
function(self, combat, dammod, subs)
.....
end
)
In the above hook, dammod used to be populated, and modifications to dammod were honored (so I could do stuff with weapon stat mods in my addon).
Now I'm getting
nil for dammod and subs, and modifications to dammod aren't being honored by the engine.
What changed?
Is there a replacement callback or hook? I don't see anything near getDammod in Combat.lua
Re: Combat:getDammod:subs hook not used anymore?
Posted: Tue Feb 05, 2019 8:55 am
by darkgod
?? bindHook function always have the same parameters list: (self, data) tah'ts all and that never has changed

What you want is data.dammod, data.subs and so on
Re: Combat:getDammod:subs hook not used anymore?
Posted: Tue Feb 05, 2019 5:16 pm
by Doctornull
darkgod wrote:?? bindHook function always have the same parameters list: (self, data) tah'ts all and that never has changed

What you want is data.dammod, data.subs and so on
Thanks, I'll do that instead!
I wonder why the code appeared to work in previous versions.
Re: Combat:getDammod:subs hook not used anymore?
Posted: Tue Feb 05, 2019 10:40 pm
by HousePet
Variable still had values assigned to it outside the scope of its definition maybe?
Re: Combat:getDammod:subs hook not used anymore?
Posted: Thu Feb 07, 2019 4:53 pm
by Doctornull
HousePet wrote:Variable still had values assigned to it outside the scope of its definition maybe?
Ah, something that used to be global turned into better code between then and 1.5.10? Possible, I guess.