nvs / gem

Gem TD+: A Warcraft III Tower Defense
https://discord.gg/PxNNp77
26 stars 2 forks source link

Use of `TriggerRegisterUnitEvent` breaks in 1.31 after loading a game #456

Closed nvs closed 5 years ago

nvs commented 5 years ago

After using save/load, Extra Chance breaks. The dialog windows do not open. I'm not sure when this started. This is specifically related to use in offline games, as I have not been able to get save/load to work on Battle.net in ages.

Further testing shows that this behavior was introduced in 1.5. However, the technique utilized in 1.5 works fine under 1.26. It also works fine in 1.30. It does not work properly under 1.31. Now, one must keep in mind that Blizzard broke save/load in multiplayer games a while back and have not fixed it. I assumed it was isolated to these cases. Turns out things in single player subtlety broke as well.

But that does not change the fact that whatever technique I switched to is causing issues (in, perhaps, a broken environment).

nvs commented 5 years ago

The issue seems to stem around use of TriggerRegisterUnitEvent. Events registered using this function are never fired after a game has been loaded. The solution (for Gem) is to rely solely upon TriggerRegisterPlayerUnitEvent.

Only the following in Gem exhibits problematic behavior: