ToME: the Tales of Maj'Eyal
http://forums.te4.org/

Combat:getDammod:subs hook not used anymore?
http://forums.te4.org/viewtopic.php?f=42&t=49403
Page 1 of 1

Author:  Doctornull [ Sun Feb 03, 2019 2:38 am ]
Post subject:  Combat:getDammod:subs hook not used anymore?

Code:
   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

Author:  darkgod [ Tue Feb 05, 2019 8:55 am ]
Post subject:  Re: Combat:getDammod:subs hook not used anymore?

?? 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

Author:  Doctornull [ Tue Feb 05, 2019 5:16 pm ]
Post subject:  Re: Combat:getDammod:subs hook not used anymore?

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.

Author:  HousePet [ Tue Feb 05, 2019 10:40 pm ]
Post subject:  Re: Combat:getDammod:subs hook not used anymore?

Variable still had values assigned to it outside the scope of its definition maybe?

Author:  Doctornull [ Thu Feb 07, 2019 4:53 pm ]
Post subject:  Re: Combat:getDammod:subs hook not used anymore?

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.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/