3.6.19 works as expected
3.7.0 sometimes works, sometimes not
Module Europe Engulfed Release 3.2.0
Steps to reproduce:
Start new scenario
(OLD works as expected)
Click Options - change U-boat build limit
*Pick a new value
*Chat log displays both correct old value and new value
(OLD does NOT work)
Click Options - change Bomber/Fighter cost
*Pick a new value
*Chat log displays only the new value
The âSet Bomber Costâ trait is only defined in the German Bomber piece, but because it is changing a Global Property, it affects both the Allied and German Costs.
I donât see how this can possibly have worked before, it certainly wasnât designed to, nor was I aware that this was happening. Global Properties should never appear as an oldXXXX value.
I will look into this but it looks like a inadvertent bug/feature.
Ok, So, it was definitely a bug and should never have happened. Itâs leakage from the Set Global Property trait. Part of the problem is that it is not consistent, If a piece does not have a SGP for a Global Property, then it will not have an oldName value for that Global Property, even if it causes the value of that GP to change, say by issuing a GKC from trigger to cause some other piece to change the GP.
However, I agree, I think it is now âassumed functionalityâ, or whatever that term is and will have to be reverted.
BTW - FWIW, this reminds me of an earlier similar problem (which you were kind enough to fix for me), whereby âoldMapâ was not defined if a unit had never been moved, so if you deleted it, you couldnât report itâs original location.
So again, for 4.0 - suggest that upon initialization of a property (local/global/system), both the $Property$ and $oldProperty$ always be set.
Just to confirm, for Global Properties, the $oldProperty$ will only be set if using âSet Global Propertyâ and not if using any of the other mechanisms (e.g., the new Scenario Options, for for instance). Answer wonât affect my module, but will be for future development awarenessâŚ
Yes, that is correct. The creation of the oldProperty value is an unintended side-effect of Set Global Property, there is no way to generalise it for all Global Properties.
However, for 4.0 I definitely would like to see both Global and Local properties have the ability to call the previous value via the âoldXXXâ construct, regardless of how the global/local property is changedâŚ