HomeWildfire Games

Fix certain modifiers not being cleared corectly from cache

Description

Fix certain modifiers not being cleared corectly from cache

Issue noticed by Exodarion.

After researching technology for resourcetrickle modifiers were returning old cached value because modifiers were not cleared for structure when it was build and changed owner from invalid_owner to the player so old values were kept.

Cause:
global cache depends on originalvalue.
Health and other modifiers use also player-wide modifiers and result from that is used as the key, what means global cache is never used because originalvalue will differ in that case.
That does not look to be case for resourcetrickle and possibly for another scenarios.
Modifiers that get cached on init and do not get changed by player-wide modifiers in combination with ownership being changed afterwards will bug.
Since we dont reset cache for ownership going from invalid_player, the old global cache is kept and used.

Another solution would be to not cache on init, but thats workaround to hide the issue.

Differential revision: D4395