parnic / LibDogTag-Unit-3.0

2 stars 1 forks source link

Fix issues caused when a newer version of LDT is loaded after LDT-Unit is loaded. #2

Closed ascott18 closed 3 years ago

ascott18 commented 3 years ago

See https://github.com/ascott18/TellMeWhen/issues/1873#issuecomment-801917542.

Not exactly why this particular user had this scenario happen (LDT hasn't had an update for a considerable amount of time...), but nonetheless it is pretty clear what happened: 1) LDT loads 2) LDT-Unit loads 3) A newer version of LDT loads. Part of the upgrade process is a wipe of the DogTag root library table.. As a result, functions that LDT-Unit stores on the DogTag library table get wiped out.

This change: 1) Moves LDT-Unit owned functions to the DogTag_Unit library table. It copies (some of) these to the DogTag table too for backwards-combat for addons that are accessing undocumented internals. 2) Removes upvaluing of any members of DogTag that are not safe to upvalue because they change across version upgrades