PDA

View Full Version : Bug in code



bratch9
September 25th, 2020, 16:59
Found a case when 'power_page.lua', 'onPowerWindowAdded' is been called before its 'onInit' for this class..

I was under the impression 'onInit' would always be called first ?

Not sure if this is a special case due to this been in a list of items, or if its possible to in-general manage to call functions on classes before they are initialised...

I've attached a zip with a campaign and the 5e rule set file with debug chat in the onInit and onPowerWindowAdded functions.

You just need to open the campaign 'camp', open character 'bob' and swap to the 'actions' tab.

( just unzip and place into FGC or FGU with an unpacked 5e ruleset... etc.. )

-pete

Moderator: Moved to a more appropriate place.

Moon Wizard
September 25th, 2020, 18:14
When a window is initialized, then all the child control onInit functions are called in order of definition; then the windowinstance onInit is called. It is possible that due to events or script calls that other functions within a window/control script can be called before the onInit function.

Regards,
JPG