HomeWildfire Games

Resolve issue with palisade health in Structure Tree


Resolve issue with palisade health in Structure Tree

The "health" of the palisade wallset was not being displayed correctly in the
Structure Tree for any civ that didn't have the same resultant civbonus effect
as the first civ shown when the 'Tree was opened.

The issue was caused by caching the parsed form of an entity template when it is
first requested, then using that for *every* civ.

This wouldn't matter if every civ had completely different entities from every
other civ, and no civ had civbonus technologies that affect shared entities.

However, in "vanilla" 0 A.D., the templates of the palisade wallset, and those
of the sheep, pig, and goat trainables, are shared between multiple civs. And
the athen, brit, gaul, mace, and spart civs all have civbonus technologies that
affect structure health.

(And as for mods, who knows...)

The solution provided here is to cache parsed entities by civ, like we already
do with technologies.

Issue raised by @Nescio in https://code.wildfiregames.com/rP23808