Typhlomence
Magical Tomomo
I wanted to use a hook onto CanHaveUpgrade to only allow a certain unit to upgrade under specific circumstances. However, it seems like the game still allows me to upgrade the unit even if my hooked function goes down a path that returns false.
Even if hook a dummy function to CanHaveUpgrade that only returns false and should therefore prevent anything from upgrading, if I understand the function correctly, the game seems to ignore the result. It doesn't work when I use CL's Malaysia mod, either - I can upgrade workers to Pesilats even if there's no enemy unit within two tiles.
So does this hook actually work? I did clear my cache just to see if that was the issue, and still no luck... Or am I just misunderstanding how to use it?
Even if hook a dummy function to CanHaveUpgrade that only returns false and should therefore prevent anything from upgrading, if I understand the function correctly, the game seems to ignore the result. It doesn't work when I use CL's Malaysia mod, either - I can upgrade workers to Pesilats even if there's no enemy unit within two tiles.
So does this hook actually work? I did clear my cache just to see if that was the issue, and still no luck... Or am I just misunderstanding how to use it?